Complete the code to initialize the left pointer at the start of the array.
int left = [1];The left pointer starts at index 0, the beginning of the array.
Complete the code to move the right pointer to the end of the array.
int right = [1] - 1;
The right pointer starts at the last index, which is array_length - 1.
Fix the error in the loop condition to continue while left is less than right.
while ([1] < right) { /* process */ }
The loop runs while the left pointer is less than the right pointer.
Fill both blanks to move pointers correctly based on sum comparison.
if (sum < target) { [1]++; } else { [2]--; }
If sum is less than target, move left pointer forward to increase sum. Otherwise, move right pointer backward to decrease sum.
Fill the blanks to correctly handle sum comparisons, checking equality first.
if (sum == target) { // found pair } else if (sum [1] target) { [2]++; } else { [3]--; }
Check equality first. If sum < target, increment left to increase sum. Else (sum > target), decrement right to decrease sum.
