Тёмный

Cracking Common Interview Algorithm Patterns: Sliding Window Part 2 of 3 

Coderbyte
Подписаться 26 тыс.
Просмотров 4 тыс.
50% 1

We’re continuing our common coding interview patterns series by focusing on the sliding window pattern.
Check out our video intro on this pattern: • Cracking Common Interv...
The Challenge:
Given an array of positive numbers and a positive number s, find the length of the smallest contiguous subarray whose sum is greater than or equal to s. Return 0 if no such subarray exists.
Video Overview:
1:24 Overview of what it is
2:54 The problem
5:28 An example
14:42 Algorithm summary
16:55 Coding a javascript implementation
32:52 Recap
Please subscribe to our channel!
What types of videos would you like to see next? Let us know in the comments.
Additional Resources:
* Practice hundreds of real coding challenges at coderbyte.com/
* Need more practice? Check out our channel for more videos on preparing for a coding interview / coderbytedevelopers

Опубликовано:

 

2 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 11   
@akinhwan
@akinhwan 2 года назад
thanks for the video, love the series!
@karimhekal
@karimhekal 2 года назад
Thank you so much, Your content is so under-rated .
@Dennis-Ong
@Dennis-Ong 2 года назад
Thank you for your video!
@vincent3542
@vincent3542 2 года назад
Thankyou mam, really appreciate it!!
@enihar
@enihar 2 года назад
this was great.
@JohnnyKidder
@JohnnyKidder 2 года назад
Great video
@PsychonauticResearch
@PsychonauticResearch Год назад
so easy when you explain it this way. Please keep posting these writeups!
@fancyAlex1993
@fancyAlex1993 2 года назад
She is really a good teacher
@mapsstar
@mapsstar 2 года назад
i found an issue when you add numbers in the array that are larger than s if (windowSum == s) { minLength = Math.min(minLength, currentWindowLen) } ^ this check inside of the while loop will prevent it from happening
@amorfati4559
@amorfati4559 Год назад
Why is it an issue to add numbers bigger than s? Maybe a better solution to optimize it would be done outside the for loop: if(arr[windowEnd] >= s){return 0;} If you find a single element >= s, then you don't have to keep iterating.
@mikeynavarro3195
@mikeynavarro3195 Год назад
If you are given a window size that is greater than your array. Then set your window size. length = to your array.length.
Далее
Being Competent With Coding Is More Fun
11:13
Просмотров 86 тыс.
🎙Пою РЕТРО Песни💃
3:05:57
Просмотров 1,3 млн
У КОТЯТ ОТКРЫЛИСЬ ГЛАЗКИ#cat
00:26
Top 7 Algorithms for Coding Interviews Visualized
33:45
Sliding Window Technique - Algorithmic Mental Models
36:45
Complex Recursion Explained Simply
24:00
Просмотров 23 тыс.
Bjarne Stroustrup: C++ | Lex Fridman Podcast #48
1:47:13
🎙Пою РЕТРО Песни💃
3:05:57
Просмотров 1,3 млн