Complete the code to initialize the left pointer at the start of the array.
left := [1]The left pointer starts at index 0 to begin scanning from the start of the array.
Complete the code to move the right pointer from the end of the array.
right := len(arr) [1] 1
The right pointer starts at the last index, which is length minus one.
Fix the error in the loop condition to continue while left is less than right.
for left [1] right {
The loop should run while left pointer is less than right pointer to avoid overlap.
Fill both blanks to correctly update pointers based on sum comparison.
if arr[left]+arr[right] [1] target { right[2] }
If the sum is greater than target, move right pointer left to reduce sum.
Fill all three blanks to handle sum less than target and equal cases.
if arr[left]+arr[right] [1] target { left[2] } else if arr[left]+arr[right] [3] target { // Found the pair }
If sum is less than target, move left pointer right to increase sum. If equal, pair found.
