Тёмный

Permutation in String - Leetcode 567 - Fixed Sliding Window (Python) 

Greg Hogg
Подписаться 204 тыс.
Просмотров 9 тыс.
50% 1

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

 

27 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 32   
@GregHogg
@GregHogg 3 месяца назад
Master Data Structures & Algorithms For FREE at AlgoMap.io!
@rocksays80
@rocksays80 2 месяца назад
This is a more clear explanation than Neetcode. Solidified the concept right away. Thanks!
@SHIHJUIheh
@SHIHJUIheh 3 месяца назад
OMG! This is the clearest explanation I have seen! Really hope you keep making videos!
@GregHogg
@GregHogg 3 месяца назад
Really glad to hear that
@sanskarshrivastava5193
@sanskarshrivastava5193 Месяц назад
way simpler than whole Leet code discussion forum and editorial, you have my respect sir !
@Amanda-bg7ib
@Amanda-bg7ib 2 месяца назад
Better than Neetcode's explanation on the same problem, and more simple/ straightforward too! Came here cuz the neetcode one was too confusing and long
@ami-does-things
@ami-does-things 15 дней назад
The best explanation I have come across for this problem! thank you so much
@tauicsicsics
@tauicsicsics 2 месяца назад
After watching 3 other videos, this is the clearest of them all, finally understood this problem. Fantastic explanations, pls don't stop making leetcode videos.
@ruchikaahujaasm
@ruchikaahujaasm 2 месяца назад
Very clear and detailed line by line explanation which helped me to understand the algorithm better. Thank you for your efforts !!!!
@Alex-tm5hr
@Alex-tm5hr 3 месяца назад
Another video you explained better than anyone else! Thanks greg!
@RupertBruce
@RupertBruce 7 месяцев назад
The count array gets rid of the permutation problem and the sliding window trick gives a nicely scalable iteration. Edit: watched to the end... Nice
@3227998
@3227998 5 месяцев назад
This is an epic explanation! Thank you!
@GregHogg
@GregHogg 5 месяцев назад
Glad to hear it, thanks a ton!!
@stuartxu1509
@stuartxu1509 Месяц назад
Thank you so much for making this video! It is crystal clear!
@aly7401
@aly7401 5 месяцев назад
Simple and elegant, thank you for the great video
@GregHogg
@GregHogg 5 месяцев назад
You're very welcome :)
@Yoshi98able
@Yoshi98able 6 месяцев назад
Really helpful and well explained
@GregHogg
@GregHogg 6 месяцев назад
Glad to hear it, thanks a ton!
@guruprasadnooliveedu
@guruprasadnooliveedu 15 дней назад
for i in range(abs(len(s2)-len(s1))+1): if sorted(s1)==sorted(s2[i:i+len(s1)]): return True return False take alook mr.greg just tried
@yhh4844
@yhh4844 4 месяца назад
It's easy to understand, thank you!
@yashparekh8914
@yashparekh8914 22 дня назад
Comparing two arrays and checking if they are equal should ideally be O(n1) right? What am I understanding wrong?
@deepakumrao4555
@deepakumrao4555 15 дней назад
In this case loop only will only runs 26 times since we are comparing arrays that has only 26 values (lower case english alphabets)
@bigk9000
@bigk9000 Месяц назад
Could someone please explain to me why this is faster than the solution I wrote? def check_inclusion(s1: str, s2: str) -> bool: n1, n2 = len(s1), len(s2) if n1 > n2: return False permutations = Counter(s1) for i in range(n2): if permutations == Counter(s2[i:i + n1]): return True return False
@sowoul_
@sowoul_ 7 месяцев назад
just do this class Solution: def checkInclusion(self, s1: str, s2: str) -> bool: check = Counter(s1) temp = {} k=len(s1) for i in range(len(s2)): if i
@ridasohail4318
@ridasohail4318 7 месяцев назад
Why we build up s2 count array in the first for loop? Why can't we just build it from start in the second loop?
@GregHogg
@GregHogg 5 месяцев назад
It's just easier this way iirc
@markelmorehome
@markelmorehome 3 месяца назад
elegant.
@philipbrujic4728
@philipbrujic4728 4 месяца назад
Good video
@nagarjunachenna7773
@nagarjunachenna7773 3 месяца назад
drawing tool name please
@darkemperor9006
@darkemperor9006 3 месяца назад
confusing solution
@user-jm6gp2qc8x
@user-jm6gp2qc8x Месяц назад
again, why don't you stick to dictionaries lol
@moonlight-td8ed
@moonlight-td8ed 3 месяца назад
you just got a new sub, thank you
Далее
Brawl Stars expliquez ça
00:11
Просмотров 6 млн
Думайте сами блин
18:15
Просмотров 663 тыс.
Permutation in String - Leetcode 567 - Python
19:40
Просмотров 234 тыс.
I Solved 100 LeetCode Problems
13:11
Просмотров 172 тыс.
The size of your variables matters.
11:03
Просмотров 128 тыс.
How I would learn Leetcode if I could start over
18:03
Просмотров 635 тыс.