We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 97b4132 commit 213fb69Copy full SHA for 213fb69
C++/contains-duplicate-iii.cpp
@@ -18,7 +18,7 @@ class Solution {
18
bst.erase(bst.find(num));
19
}
20
// Every search costs time: O(logk).
21
- const auto it = bst.lower_bound(nums[i] - t);
+ const auto it = bst.lower_bound(static_cast<int64_t>(nums[i]) - t);
22
if (it == bst.cend() || (*it - nums[i]) > t) {
23
// Not found.
24
window.emplace(nums[i]);
0 commit comments