Skip to content

Commit a4ed37e

Browse files
authored
Update 2 sum cpp.cpp
1 parent 4b80b8a commit a4ed37e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

1) 2 sum (easy)/2 sum cpp.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
C++
22

3-
1) Brute Force
3+
1) Brute Force [O(n^2)]
44
class Solution {
55
public:
66
vector<int> twoSum(vector<int>& nums, int target) {
@@ -20,9 +20,9 @@ class Solution {
2020
}
2121
return ret;
2222
}
23-
}; //O(n^2)
23+
};
2424

25-
2) Hash Table
25+
2) Hash Table [O(n)]
2626
class Solution {
2727
public:
2828
vector<int> twoSum(vector<int>& nums, int target) {
@@ -43,4 +43,4 @@ class Solution {
4343
}
4444
return ret;
4545
}
46-
}; //O(n)
46+
};

0 commit comments

Comments
 (0)