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

Commit 5ca243e

Browse files
fixed an incorrect comment on 05/06/24
1 parent 19d70ce commit 5ca243e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎LC_32_kDiffPairsInAnArray.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ int bs(vector<int> &nums, int start, int x)
2525

2626
int findPairs(vector<int> &nums, int k)
2727
{
28-
// 2 pointers, tc(n*logn) & sc: O(n^2)
28+
// 2 pointers, tc(n*logn) & sc: O(n)
2929
// sort(nums.begin(), nums.end());
3030
// set<pair<int,int>> ans;
3131
// int i = 0, j = 1;
@@ -45,7 +45,7 @@ int findPairs(vector<int> &nums, int k)
4545
// }
4646
// return ans.size();
4747

48-
// binary search, tc: O(n*logn) & sc: O(n^2
48+
// binary search, tc: O(n*logn) & sc: O(n)
4949
sort(nums.begin(), nums.end());
5050
set<pair<int, int>> ans;
5151

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /