Sajeeb Das Shuvo
@me_sajeeb
Followers
48
Following
37
Media
230
Statuses
450
Software Engineer
Sunderland, United Kingdom
Joined July 2017
π’ LeetCode: Number of Substrings with Only 1s β
Two approaches: Formula vs incremental! Approach 2 = just add current streak count. Math elegance! β‘ O(n) single pass π― nΓ(n+1)/2 vs incremental π‘ 5 lines in Approach 2! #LeetCode #CPlusPlus #Math #100DaysOfCode
1
0
0
π’ LeetCode: Count Dominant Ones Substrings β
Prefix sum + math optimization! Skip impossible ranges, batch count valid ones. O(n Γ βn) optimization. β‘ Smart skipping logic π― ones β₯ zerosΒ² constraint π‘ Batch counting FTW #LeetCode #CPlusPlus #PrefixSum #100DaysOfCode
1
0
0
π LeetCode: Increment Submatrices β
Difference array magic! Mark boundaries (+1, -1), then prefix sum. Optimize from O(qΓnΒ²) to O(qΓn + nΒ²). β‘ Boundary marking technique π― Prefix sum reconstruction π‘ Classic range update trick #LeetCode #CPlusPlus #DifferenceArray
1
0
0
β‘ LeetCode: Max Ops Move Ones to End β
Elegant greedy! Count 1s, add to result at 1β0 transitions. Each 1 jumps all future 0s. β‘ O(n) single pass π― Transition detection π‘ Just 7 lines! #LeetCode #CPlusPlus #Greedy #100DaysOfCode
1
0
0
π’ LeetCode: Min Ops Make All Elements 1 β
GCD magic! Find shortest subarray with GCD=1, reduce it to 1, then propagate. Math > brute force. β‘ O(nΒ²) with GCD π― ops = (subarray_len-1) + (n-1) π‘ If no GCD=1 subarray β impossible #LeetCode #CPlusPlus #Math #100DaysOfCode
1
0
0
π° LeetCode: Ones and Zeroes β
0/1 knapsack with 2 constraints! 3D memo β 2D optimized. Backward iteration = key trick. β‘ O(lenΓmΓn) time π― 2-constraint knapsack π‘ Space: 3D β 2D optimization #LeetCode #CPlusPlus #DynamicProgramming #100DaysOfCode
1
0
0
π― LeetCode Daily: Min Ops to Zero β
Greedy + monotonic stack pattern. Track operation "layers", pop when complete, add when needed. β‘ O(n) single pass π― Stack tracks active ops #LeetCode #CPlusPlus #Greedy #100DaysOfCode
1
0
0
π― LeetCode Daily: Count Operations to Zero β
Two approaches: Simulation vs Euclidean! Division replaces repeated subtraction = O(log n) optimization. β‘ O(n) β O(log n) π― Euclidean GCD pattern #LeetCode #CPlusPlus #40DayStreak #100DaysOfCode
1
0
1