Day 13 of @geeksforgeeks 160
β‘ Smallest Positive Missing Number
βοΈ Place positives in correct index (index = value - 1)
βοΈ Ignore negatives & out-of-bound values
β³ TC: O(N), π SC: O(1)
#gfg160#geeksforgeeks#geekstreak2025
Day 12 of @geeksforgeeks 160
π Max Circular Subarray Sum (Kadane's)
βοΈ Max normal subarray sum using Kadaneβs
βοΈ Min subarray sum using modified Kadaneβs
π Max circular = max(normal, totalSum - minSubarray)
β³ TC: O(N), π SC: O(1)
#gfg160#geeksforgeeks#geekstreak2025
Day 11 of @geeksforgeeks 160
β‘ Maximum Product Subarray
βοΈ Track both max & min product at every step (handles negatives)
βοΈ Reset on encountering 0
π§ Edge case: negatives can flip max/min
β³ TC: O(N), π SC: O(1)
#gfg160#geeksforgeeks#DSA#maxproduct#geekstreak2025
Day 8 of @geeksforgeeks 160
πΉ Stock Buy & Sell β Max One Transaction Allowed (One Pass)
β Track minimum price so far
β Update max profit at each step
β³ TC: O(N), π SC: O(1)
#gfg160#geeksforgeeks#geekstreak2025