Complete the code to initialize the left pointer at the start of the list.
left = [1]The left pointer starts at index 0 to begin sorting from the start.
Complete the code to initialize the right pointer at the end of the list.
right = [1]The right pointer starts at the last index, which is length minus one.
Fix the error in the while loop condition to continue sorting while pointers do not cross.
while [1] <= right:
The variable 'i' is used to traverse the list and should be compared to 'right'.
Fill both blanks to swap elements and move the left pointer forward.
nums[[1]], nums[[2]] = nums[[2]], nums[[1]] left += 1
Swap the current index 'i' with 'left' pointer, then move 'left' forward.
Fill both blanks to swap elements, move the right pointer backward, and continue without incrementing i.
nums[[1]], nums[[2]] = nums[[2]], nums[[1]] right -= 1 continue
Swap the current index 'i' with 'right' pointer, move 'right' backward, and continue without incrementing 'i'.