Algorithm Sliding Window - Dynamic Version

  Рет қаралды 5,021

DuoWei Education

DuoWei Education

Күн бұрын

Don't forget to like 👍🏼, comment and subscribe for more videos and tutorials like this!
#competitiveprogramming #coding #python #learnpython #graphs #java #slidingwindow

Пікірлер: 10
@jamjam3448
@jamjam3448 Ай бұрын
thanks very much
@sundayndu
@sundayndu 4 күн бұрын
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
@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
@ffsnewboi9919 Жыл бұрын
Keep the videos coming! Loved it
@primalwarlord
@primalwarlord 8 ай бұрын
Nice explaination.. Loved it
@hatefraheeme4020
@hatefraheeme4020 8 ай бұрын
Great explanation bro.
@adeleyejeremiah4059
@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.
@waqasshoukat7792
@waqasshoukat7792 2 жыл бұрын
Good Attempt
@chanduiit42
@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
@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)
Sliding Window Leetcode Problem Solved with JavaScript
15:01
James Q Quick
Рет қаралды 6 М.
JavaScript Sliding Window Technique - Fixed Size
15:19
The Code Creative
Рет қаралды 14 М.
Schoolboy - Часть 2
00:12
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 7 МЛН
Получилось у Миланы?😂
00:13
ХАБИБ
Рет қаралды 6 МЛН
2 Simple Steps for Solving Any Sliding Window Problem
10:12
Austin Lee
Рет қаралды 1,6 М.
The hidden beauty of the A* algorithm
19:22
polylog
Рет қаралды 851 М.
Stop, Intel’s Already Dead!
13:47
Linus Tech Tips
Рет қаралды 723 М.
JPEG is Dying - And that's a bad thing
8:09
2kliksphilip
Рет қаралды 161 М.
8 patterns to solve 80% Leetcode problems
7:30
Sahil & Sarra
Рет қаралды 292 М.
Sliding Window Technique | Google Coding Interview | Maximum Size SubArray Of Size K
16:06
JAVAAID - Coding Interview Preparation
Рет қаралды 64 М.
Sliding Window Technique
6:18
Profound Academy
Рет қаралды 7 М.
Schoolboy - Часть 2
00:12
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 7 МЛН