Two Sum II - Input Array Is Sorted
Difficulty: Medium
Source: LeetCode
Description
You are given a 1-indexed integer array numbers that is sorted in non-decreasing order and an integer target.
Your task is to return the 1-based indices of two different elements in numbers whose sum is exactly equal to target, with the guarantee that exactly one such pair exists
Please see full description in this link
Example
Example 1:
Input: numbers = [2, 7, 11, 15], target = 9
Expected output: [1, 2]
Explanation: numbers[1] + numbers[2] = 2 + 7 = 9, so the correct indices are [1, 2].
Code
# To be solved