Skip to content

Commit ebe8eda

Browse files
committed
feat: Solve leetcode/leetcoding_challenge/2025/apr2025/week4/count_subarrays_with_fixed_bounds.cpp
1 parent 4b24efc commit ebe8eda

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

src/onlinePlatform/leetcode/leetcoding_challenge/2025/apr2025/week4/count_subarrays_with_fixed_bounds.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ class Solution {
3636
int right = 0;
3737
multiset<int> bst;
3838
while (right < nums.size()) {
39-
cout << "right: " << right << " nextInvalidIndices[right]: " << nextInvalidIndices[right] << endl;
4039
if (nums[right] < minK || nums[right] > maxK) {
41-
cout << "reset" << endl;
4240
bst = multiset<int>();
4341
right++;
4442
left = right;
@@ -47,26 +45,14 @@ class Solution {
4745

4846
bst.insert(nums[right]);
4947

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-
5948
while (bst.size() > 0 && *begin(bst) == minK && *prev(end(bst)) == maxK) {
6049
int count = nextInvalidIndices[right] - right;
61-
cout << "add count: " << count << " answer:" << answer << endl;
6250
answer += count;
6351

6452
// multiset.erase erase all occurences :/
6553
// bst.erase(nums[left]);
66-
6754
eraseOne(bst, nums[left]);
6855

69-
cout << "now: " << bst.size() << " " << *begin(bst) << " _ " << *prev(end(bst)) << endl;
7056
left++;
7157
}
7258

0 commit comments

Comments
 (0)