diff --git a/algorithms/cpp/twoSum/twoSum.cpp b/algorithms/cpp/twoSum/twoSum.cpp index f0e9692e..94f87cfb 100644 --- a/algorithms/cpp/twoSum/twoSum.cpp +++ b/algorithms/cpp/twoSum/twoSum.cpp @@ -59,8 +59,8 @@ class Solution { m[target - numbers[i]] = i; }else { // found the second one - result.push_back(m[numbers[i]]+1); - result.push_back(i+1); + result.push_back(m[numbers[i]]); + result.push_back(i); break; } }