Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf3b471c

Browse files
Add C++ implementation
Signed-off-by: begeekmyfriend <begeekmyfriend@gmail.com>
1 parent2be5ee9 commitf3b471c

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

‎0001_two_sum/two_sum.cc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Solution {
99
unordered_map<int,int> ht;
1010
for (int i =0; i < nums.size(); i++) {
1111
int other = target - nums[i];
12-
if (ht.find(other) != ht.end()) {
12+
if (ht.count(other)) {
1313
/* Only one solution for purpose of this problem*/
1414
res.append(ht[other]);
1515
res.append(i);

‎0001_two_sum/two_sum.py‎

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp