Loading...
Find two numbers in a sorted array that add up to a target value. Return their indices using the two-pointer technique.
Create two pointer variables: left = 0 (start of array) and right = len(arr) - 1 (end of array)
left = 0
right = len(arr) - 1
def two_sum(arr, target): # Return indices of two numbers in sorted arr that add up to target # Return [-1, -1] if no pair found pass