From bb5343ff111990b83f930febcd8d9c6e850f0e0b Mon Sep 17 00:00:00 2001 From: Alibek Seitov <65224356+effuone@users.noreply.github.com> Date: Sun, 10 Jul 2022 23:11:29 +0600 Subject: [PATCH] fix of unnecessary increment incrementation in lines 62 and 63 is unnecessary, because leetcode test cases failed --- algorithms/cpp/twoSum/twoSum.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } }