| 2 | class Solution { |
| 3 | public: |
| 4 | vector<int> twoSum(vector<int>& nums, int target) { |
| 5 | vector<int> v(2); |
| 6 | for(int i = 0; i<nums.size(); i++){ |
| 7 | for(int j = i+1; j<nums.size();j++){ |
| 8 | if(nums[j] == target-nums[i]){ |
| 9 | v[0] = i; |
| 10 | v[1] = j; |
| 11 | return v; |
| 12 | } |
| 13 | } |
| 14 | } |
| 15 | return v; |
| 16 | } |
| 17 | }; |
| 18 | |
| 19 | // Above solution is of O(n^2) time complexity |
nothing calls this directly
no outgoing calls
no test coverage detected