File tree Expand file tree Collapse file tree 1 file changed +0
-14
lines changed
src/onlinePlatform/leetcode/leetcoding_challenge/2025/apr2025/week4 Expand file tree Collapse file tree 1 file changed +0
-14
lines changed Original file line number Diff line number Diff line change @@ -36,9 +36,7 @@ class Solution {
36
36
int right = 0 ;
37
37
multiset<int > bst;
38
38
while (right < nums.size ()) {
39
- cout << " right: " << right << " nextInvalidIndices[right]: " << nextInvalidIndices[right] << endl;
40
39
if (nums[right] < minK || nums[right] > maxK) {
41
- cout << " reset" << endl;
42
40
bst = multiset<int >();
43
41
right++;
44
42
left = right;
@@ -47,26 +45,14 @@ class Solution {
47
45
48
46
bst.insert (nums[right]);
49
47
50
- try {
51
- cout << right << " " ;
52
- cout << *begin (bst) << " _ " ;
53
- cout << *prev (end (bst)) << " __ " ;
54
- cout << *end (bst) << " ___ " << endl;
55
- } catch (const std::exception& e) {
56
- cout << " _e_ " << endl;
57
- }
58
-
59
48
while (bst.size () > 0 && *begin (bst) == minK && *prev (end (bst)) == maxK) {
60
49
int count = nextInvalidIndices[right] - right;
61
- cout << " add count: " << count << " answer:" << answer << endl;
62
50
answer += count;
63
51
64
52
// multiset.erase erase all occurences :/
65
53
// bst.erase(nums[left]);
66
-
67
54
eraseOne (bst, nums[left]);
68
55
69
- cout << " now: " << bst.size () << " " << *begin (bst) << " _ " << *prev (end (bst)) << endl;
70
56
left++;
71
57
}
72
58
You can’t perform that action at this time.
0 commit comments