[Java] Leetcode 76. Minimum Window Substring [Sliding Window #8]

preview_player
Показать описание
In this video, I'm going to show you how to solve Leetcode 76. Minimum Window Substring which is related to Sliding Window.

Here’s a quick rundown of what you’re about to learn:

⭐️ Course Contents ⭐️
⌨️ (0:00) Question
⌨️ (1:13) Solution Explain
⌨️ (5:02) Code

In the end, you’ll have a really good understanding on how to solve Leetcode 76. Minimum Window Substring and questions that are similar to Sliding Window.

Now, if you want to get good at Sliding Window, please checkout my Sliding Window playlist.

Рекомендации по теме
Комментарии
Автор

Thank you for the explanation! I was able to solve this problem using a condition 'window contains the min number of t characters' however I was using a set and two frequency maps so the solution was slow. It is nice to learn about a better & faster way to solve these problems with just one frequency map :)

MangoTroll
Автор

One thing I don't get is why minLen is set to Max_Value. For line 33 isn't it usually always going to be true? I don't understand setting curWindow to minLen also. Could you explain? Thank you!!

alexshay
Автор

Please do mention Time and Space complexity of the code in the description

mehboobshah
Автор

Store freq if t in 1 map and change it acc to main string and finally give output

divyanshtripathi
Автор

It's very weird that your code runs at 7ms and mine is around 125ms. Both are exactly the same code. Magic?

journalist
Автор

Wouldn't ++arr[leftChar] > 0 hold true for every character?

slimreaper
visit shbcf.ru