Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number. Return their indices as [index1, index2] (1-indexed). You may not use the same element twice. Use only constant extra space.
numbers = [2,7,11,15], target = 9[1,2]numbers = [2,3,4], target = 6[1,3]Array is sorted. Sum too small → only moving L right can increase it (left value grows). Sum too large → only moving R left can decrease it (right value shrinks). This monotonicity guarantees we find the unique solution in a single pass — no brute-force needed.