10000 fix of unnecessary increment by effuone · Pull Request #276 · haoel/leetcode · GitHub
[go: up one dir, main page]

Skip to content

fix of unnecessary increment #276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix of unnecessary increment
incrementation in lines 62 and 63 is unnecessary, because leetcode test cases failed
  • Loading branch information
effuone authored Jul 10, 2022
commit bb5343ff111990b83f930febcd8d9c6e850f0e0b
4 changes: 2 additions & 2 deletions algorithms/cpp/twoSum/twoSum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
0