Don't forget to like 👍🏼, comment and subscribe for more videos and tutorials like this! #competitiveprogramming #coding #python #learnpython #graphs #java #slidingwindow
Пікірлер: 10
@jamjam3448Ай бұрын
thanks very much
@sundayndu4 күн бұрын
Nice visualization of sliding window technique, infact one of the best out there. However, I don't think you are meant to reassign the answer [and = min(and, r - l +1) in the while loop. It should be done outside the while loop to also consider answers in situations that matches the condition(sum< S). We got away with it in this case because, the algorithm is asking for the smallest subarray.
@skillkrio Жыл бұрын
Hey i wanna give a tight hug to you. 3 days i was trying to learn this concept understood the static window but couldn't get understand how dynamic window. I don't know the term dynamic but conceptually i am trying to increase the windows size until my desired result comes. But dont' know how to implement it . Thank you for taking your time and explaining the entire concept slowly without any rush. Please continue your video either c++ or java. It is widely used in dsa . I had solved 3 problem on my own after your video . You are a life saver Man.
@ffsnewboi9919 Жыл бұрын
Keep the videos coming! Loved it
@primalwarlord8 ай бұрын
Nice explaination.. Loved it
@hatefraheeme40208 ай бұрын
Great explanation bro.
@adeleyejeremiah4059 Жыл бұрын
Honestly, you have done a good job to this dynamic sliding window than other videos I have watched in the time past. I have also struggled to understand the concept of dynamic sliding window but I got more confused each time I visit a video on it and now you have made it look like it is a piece of cake. thank you for this gesture. However, You didn't calculate big O notation of the approach you used in 19:18 because I can see while loop within a for loop which is appearing to me as O of N square, I will like clarification on that.
@waqasshoukat77922 жыл бұрын
Good Attempt
@chanduiit42 Жыл бұрын
Wonderful explanation...can you explain the correctness of this approach..as in how does this dynamic sliding window ensure that all the subarrays are seen and calculated? Thanks in advance.
@qwertyqwerty-si8nn Жыл бұрын
Kindly verify my solution in python: import math arr = [5,2,8,10,5,7,2,9] S = 15 lst = [] length = math.inf end = 0 for i in range(len(arr)): if sum(lst) >=S: length = min(length, len(lst)) lst.pop(0) else: lst.append(arr[end]) end+=1 print(length)