:type numbers: List[int] :type target: int :rtype: List[int]
(self, sortedNums, target)
| 22 | """ |
| 23 | class Solution(object): |
| 24 | def twoSum(self, sortedNums, target): |
| 25 | """ |
| 26 | :type numbers: List[int] |
| 27 | :type target: int |
| 28 | :rtype: List[int] |
| 29 | """ |
| 30 | |
| 31 | start = 0 |
| 32 | end = len(sortedNums) - 1 |
| 33 | while start <= end: |
| 34 | # print(nums[start] + nums[end]) |
| 35 | if sortedNums[start] + sortedNums[end] == target: |
| 36 | return start+1, end+1 |
| 37 | |
| 38 | if sortedNums[start] + sortedNums[end] > target: |
| 39 | end -= 1 |
| 40 | else: |
| 41 | start += 1 |
| 42 |
nothing calls this directly
no outgoing calls
no test coverage detected