(int[] numbers, int target)
| 1 | class Solution { |
| 2 | public int[] twoSum(int[] numbers, int target) { |
| 3 | int start=0; |
| 4 | int end=numbers.length-1; |
| 5 | while(start<end) |
| 6 | { |
| 7 | int sum = numbers[start] + numbers[end]; |
| 8 | if(sum==target) |
| 9 | { |
| 10 | return new int[]{start+1,end+1}; |
| 11 | } |
| 12 | if(sum<target) start++; |
| 13 | else end--; |
| 14 | } |
| 15 | return null; |
| 16 | } |
| 17 | } |
nothing calls this directly
no outgoing calls
no test coverage detected