Minimum window substring | LeetCode Hard problem | Detailed solution with code | DSA
problem link:
leetcode.com/problems/minimum...
solution:
ideone.com/KEt3s5
__________________________________________________________________________
All my playlists:
DSA sheet:
• 450 questions DSA sheet
Interview experiences:
• Internship tests/Inter...
Leetcode problems:
• leetcode problems
projects for resume:
• Projects for Resume
Connect with me on LinkeIn:
/ aditya-rajiv-0606491a5
Connect with me on Instagram:
/ adi_rajiv
#leetcode #strings #slidingwinodw #dsa #softwareengineer #SDE #Placement #competitiveprogramming #faang #recursion
Пікірлер: 15
keep making video one of the best video for sliding window
best explaination on YT for this problem
Helpful , best explaination on YT ! 👏👏👏👏
explanation at speed of 1.75 is best to understand and save time
clean and readable code, good work!
Thanks! It helped me. ^_^
Hello you have initialised the vector ( the map to store frequencies) by 0, but later on in the video you said the frequency of elements which are not in 't' string would be -1. Is there a correction that I am missing sir?
what if string s contains AAA in the starting count will increase each time then after that count will be equal to s ka size it will update minlenth and ans will be zero plz explain request
thx
You should have to be cool and think about the approach he is using and do 2-3 dry runs. He is actually explaining best on entire youtube.
#bestexplanation
from collections import Counter def minimum_window(str1,str2): window="a"*(len(str1)+1) left=0 count=0 hashmap=Counter(str2) for i in range(len(str1)): if str1[i] in hashmap: hashmap [str1[i]]-=1 if hashmap [str1[i]]>=0: count+=1 while count==len(str2): if len(str1[left:i+1]) window=str1[left:i+1] if str1[left] in hashmap: hashmap [str1[left]]+=1 if hashmap [str1[left]]>0: count-=1 left+=1 return window str1='ADOBECODEBANC' str2='ABC' print(minimum_window(str1,str2)) str1 = "PRWSOERIUSFK" str2 = "OSU" print(minimum_window(str1,str2))
not helpful
@world4coding
10 ай бұрын
You should have to be cool and think about the approach he is using and do 2-3 dry runs. He is actually explaining best on entire youtube.
@alhassanecamara2095
6 ай бұрын
He also do his best to make the video sort and easy to watch!