the answer is : class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { for(int i = 0; i < nums.size()-1; i++) { for(int j = i+1; j< nums.size(); j++) { if(nums[i] + nums[j] == target) { return {i, j}; } } } return {}; } }; <img width="167" alt="Screen Shot 2021-04-06 at 9 03 04 AM" src="https://user-images.githubusercontent.com/12002183/113644307-1034a800-96b7-11eb-9581-37e896d35abd.png"> but submit can be accepted. <img width="343" alt="Screen Shot 2021-04-06 at 9 07 49 AM" src="https://user-images.githubusercontent.com/12002183/113644598-b41e5380-96b7-11eb-891d-23c255d61a43.png">