Skip to content

Commit 977eb2b

Browse files
authored
typing error? (kamyu104#121)
typing error?
1 parent 735f039 commit 977eb2b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

C++/check-if-a-number-is-majority-element-in-a-sorted-array.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ class Solution {
1616
}
1717
const auto& l = lower_bound(nums.cbegin(), nums.cend(), target);
1818
const auto& r = upper_bound(nums.cbegin(), nums.cend(), target);
19-
return r - l;
19+
return (r - l) * 2 > nums.size();
2020
}
2121
};

0 commit comments

Comments
 (0)