@BTZOglobal MI 💙
The Raipur pitch can get some really good for batting after the powerplay, and with MI’s batting depth, I feel they’ll outscore RCB tomorrow
Day 22 : Minimum K Consecutive Bit Flips
@geeksforgeeks@NPCI_NPCI
Greedy approach: flip when current effective bit is 0.
Track active flips using a difference array to achieve O(n).
Time: O(n) | Space: O(n)
#geekstreak60#GFG60#DSA#Java
Day 21: Sum of Subarray Minimums
Use monotonic stacks to find previous & next smaller elements.
@geeksforgeeks@NPCI_NPCI
Each element contributes arr[i] × left × right.
Time: O(n) | Space: O(n)
#geekstreak60#GFG60#DSA#Java
Day 20: Subarrays with First Element Minimum
For each index, find the next smaller element to the right using a monotonic stack.
@geeksforgeeks@NPCI_NPCI
Valid subarrays = distance to that element.
Time: O(n) | Space: O(n)
#geekstreak60#GFG60#DSA#Java
Day 19 : Largest Number in One Swap
Store last index of digits (0–9)
@geeksforgeeks
For each position, tried swapping with the largest digit appearing later to maximize the number
@NPCI_NPCI
Time: O(n) | Space: O(1)
#geekstreak60#GFG60#DSA#Java
Day 15 : Longest Substring with K Uniques #geekstreak60
Use a sliding window + frequency array.
Expand right pointer, shrink left when distinct chars > k.
Update answer when distinct == k.
Time: O(n) | Space: O(1)
#GFG60#DSA#Java#NPCL
Day 14 Trapping Rain Water #geekstreak60
Water at each index depends on min(maxLeft, maxRight).
Using two pointers, track leftMax and rightMax while traversing from both ends.
Efficient solution without extra arrays.
Time: O(n) | Space: O(1)
#GFG60#NPCL#DSA#Java
Day 13: Max XOR Subarray of Size K #geekstreak60
Use a sliding window of size k.
Compute XOR of the first window, then update by removing the left element and adding the next element using XOR properties.
Time: O(n) | Space: O(1)
#GFG60#DSA@NPCI_NPCI#NPCL