Given a 1-indexed array of integers nums sorted in non-decreasing order and an integer target, find two numbers that add up to target and return their 1-based indices i < j. Exactly one solution exists; use only O(1) extra space.
Input
nums (sorted)targetOutput
2 7 11 15 9
1 2
2 + 7 = 9 → indices 1 and 2.
-1 0 -1
1 2
Run your code against the sample tests, or Submit to run the full suite.