Yogesh ..’s Post

Day 53/100 | #100DaysOfDSA 🧩🚀 Today’s problem: Minimum Window Substring One of the most important sliding window problems. String properties: • We need a substring containing all characters of another string • Characters can repeat • The answer must be the smallest valid window Key idea: Use the sliding window technique with two pointers. Why? • Expanding the window helps include required characters • Shrinking the window helps find the minimum length • Efficiently balances both conditions Approach: • Store frequency of characters from string t • Use two pointers (left & right) to form a window • Expand right pointer to include characters • Decrease required count when a valid char is found • Once all chars are matched → try shrinking from left • Track the minimum window length during the process Time Complexity: O(n + m) Space Complexity: O(1) (constant for character set) Big takeaway: Sliding window is all about expand → satisfy → shrink → optimize. Sliding window concepts getting stronger day by day. 🔥 Day 53 done. #100DaysOfCode #LeetCode #DSA #Algorithms #SlidingWindow #Strings #Java #CodingJourney #ProblemSolving #InterviewPrep #TechCommunity

  • graphical user interface, text

To view or add a comment, sign in

Explore content categories