Utsa Paul
27 posts

Utsa Paul
@utsapaul
Coder | engineering my dreams
Kolkata Katılım Şubat 2026
6 Takip Edilen3 Takipçiler

#POTD @geeksforgeeks
Day 23/60 – powered by @NPCI_NPCI
Minimum K Consecutive Bit Flips:
Greedy traversal while tracking active flips using a sliding window.
Takeaway: Tracking flip parity avoids repeated array modifications.
#geekstreak60 #npci #DSA

English

#POTD @geeksforgeeks
Day 22/60 – powered by @NPCI_NPCI
Sum of Subarray Minimums:
Used monotonic stack to find previous and next smaller elements and compute contribution.
Takeaway: Element contribution simplifies many subarray aggregate problems.
#geekstreak60 #npci #DSA

English

#POTD @geeksforgeeks
Day 21/60 – powered by @NPCI_NPCI
Subarrays with First Element Minimum:
Used a monotonic stack to find the next smaller element and count valid subarrays.
Takeaway: Next smaller element helps define subarray boundaries efficiently.
#geekstreak60 #npci #DSA

English

#POTD @geeksforgeeks
Day 20/60 – powered by @NPCI_NPCI
Largest Number in One Swap:
Traverse from right to track the largest digit and swap with the earliest smaller digit.
Takeaway: Right-to-left scanning helps identify optimal swap positions.
#geekstreak60 #npci #DSA

English

#POTD @geeksforgeeks
Day 18/60 – powered by @NPCI_NPCI
Dice Throw:
Used DP where dp[i][j] counts ways to get sum j using i dice.
Takeaway: Break combinatorial problems into smaller states.
#geekstreak60 #npci #DSA

English

#POTD @geeksforgeeks
Day 17/60 – powered by @NPCI_NPCI
Smallest Window Containing All Characters:
Two-pointer sliding window with frequency maps to track required characters
Takeaway: Hard problems often reduce to careful window expansion & contraction.
#geekstreak60 #npci #DSA

English

#POTD @geeksforgeeks
Day 16/60 – powered by @NPCI_NPCI
Longest Substring with K Uniques:
Sliding window with hashmap to maintain exactly K distinct characters in O(n).
Takeaway: Managing distinct counts efficiently is key in substring window problems.
#geekstreak60 #npci #DSA

English

#POTD @geeksforgeeks
Day 15/60 – powered by @NPCI_NPCI
Max XOR Subarray of size K:
Used sliding window to update XOR in O(n).
Takeaway: XOR allows efficient window updates.
#geekstreak60 #npci #DSA

English

#POTD @geeksforgeeks
Day 14/60 – powered by @NPCI_NPCI
Longest subarray with at most two distinct integers:
Used sliding window + hashmap to maintain ≤2 distinct in O(n).
Takeaway: Shrink window when constraint breaks.
#geekstreak60 #npci #DSA

English

#POTD @geeksforgeeks
Powered by @NPCI_NPCI
Day 13/60, big classic problem 🔥
Trapping Rain Water:
Precomputed left_max & right_max arrays to calculate trapped water in O(n).
Takeaway: Preprocessing boundaries simplifies accumulation problems.
#geekstreak60 #npci #DSA

English

#POTD @geeksforgeeks
Day 12/60 – powered by @NPCI_NPCI
Move All Zeroes to End:
Used two-pointer approach to swap non-zero elements forward in O(n).
Streak tested but discipline stayed ig :)
#geekstreak60 #npci #DSA

English

#POTD @geeksforgeeks
Day 11/60 – powered by @NPCI_NPCI
Find the closest pair from two arrays:
Used two pointers (start & end) to track min diff from target in O(n+m).
Takeaway: Sorted arrays + two pointers = optimal search.
#geekstreak60 #npci #DSA

English

#POTD @geeksforgeeks
Day 10/60 – powered by @NPCI_NPCI
Number of submatrices with sum X:
Used 2D prefix sum to compute square sums efficiently and iterated over all possible sizes.
Takeaway: Prefix sums turn brute force into structured computation.
#geekstreak60 #npci #DSA

English

#POTD @geeksforgeeks
Day 9/60 – powered by @NPCI_NPCI
Isomorphic Strings:
Used two hashmaps for one-to-one mapping in O(n).
Takeaway: Always validate mapping both ways.
#geekstreak60 #npci #DSA

English

#POTD @geeksforgeeks
Day 8/60 – powered by @NPCI_NPCI
Longest Subarray with Majority > K:
Mapped >k to +1, ≤k to -1. Used prefix sum + hashmap for longest valid span in O(n).
Takeaway: Turning conditions into math simplifies complex subarray logic.
#geekstreak60 #npci #DSA

English

#POTD @geeksforgeeks
Day 7/60 – powered by @NPCI_NPCI
Longest Span in Two Binary Arrays:
Tracked prefix diff (a1-a2) and used hashmap to find longest zero-sum span in O(n).
Takeaway: Reframing the problem makes it linear.
#geekstreak60 #npci #DSA

English


