Man, thank you so much. I just got my dream Google offer and I would've never ever gotten it without your videos. Thank you so much and I'll be joining you in the Seattle office this fall!
@ChanChan-pg4wu2 жыл бұрын
It indeed has been a while! Glad to see you back! Always great explanation! This reminds me to revisit permutation & backtracking.
@AMAZINGGUY11132 жыл бұрын
Thought you'd stop after your hard work paid off. Good to see that you're still at it! Keep it up man, it's greatly appreciated :)
@Mutual_Information2 жыл бұрын
Interesting to think that there is a subset of the183K subscribers who passed an interview and accepted the job because of this channel. Very strong impact
@fatihorhan93552 жыл бұрын
I'd suggest allocating a boolean array space of size 2^k and changing each corresponding place of the array with the given substring. This allows us to avoid computing the hash function and saves a lot of space since every bool is only 1 bit. (I implemented my solution in c++ and am unsure how it'd go in python 3.)
@fatihorhan93552 жыл бұрын
Beats 85% of runtime and 94% of space in c++.
@allandogreat2 жыл бұрын
Yes, good one.
@pallav70412 жыл бұрын
nice approach
@damirshakenov21982 жыл бұрын
Actually, bool is 1 byte (not bit), because the CPU can't address anything smaller than a byte.
@fatihorhan93552 жыл бұрын
@@damirshakenov2198 You're totally right. I forgot that almost all instruction architectures are designed so that smaller size CPUs can interact with is 1 byte. However, STL's boolean vector is designed to optimize for space.
@trollbaron13292 жыл бұрын
Hi NeetCode, would you consider making a video on more advanced topics like string hashing or segment trees?
@numberonep54042 жыл бұрын
Short and to the point as usual! nice pb
@udayptp2 жыл бұрын
This was as simple as tricky, loved your explanation
@VivekSingh-in6rq2 жыл бұрын
damn, i just got this challenge today and found ur video was released today too 😂😂
@jasonswift7468 Жыл бұрын
We can add if ((s.length() - k + 1) * k < (1
@shantanukumar40812 жыл бұрын
Great Explanation !!!
@halahmilksheikh2 жыл бұрын
I thought he went up to Google heaven and never returned
@NeetCode2 жыл бұрын
Lol good one
@halahmilksheikh2 жыл бұрын
@@NeetCode For real though, I thought you retired this channel. I hope you continue it even if it's at a slower cadence (like 1 per week?)
@aishwaryaranghar33852 жыл бұрын
great approach
@Malmidas2 жыл бұрын
Keep up the good work, really appreciated!
@shouryannikam39492 жыл бұрын
Is the neetcode 150 list definitive or do you plan on adding more problems to it?
@hilsCYBER2 жыл бұрын
Thanks man, great content as usual.
@nguyenquangduy9102 жыл бұрын
hey Neet, your solution is brilliant but what if (s) dont have enough sample to return the number of solution we are seeking. E.g s="0110" k=2
@minarefaat15732 жыл бұрын
Hey man We miss you
@farzinhaddadpour7192 Жыл бұрын
This is clever!
@pekarna2 жыл бұрын
Hi, hashcode is not too efficient here. Since we have a continuous sequence of integers to search for, why not have an array, 0 to 2^k-1? This leads to a quite efficient code :) Runtime: 555 ms, faster than 100.00% of Kotlin online submissions for Check If a String Contains All Binary Codes of Size K. Memory Usage: 68.4 MB, less than 100.00% of Kotlin online submissions for Check If a String Contains All Binary Codes of Size K.
@mohithadiyal60832 жыл бұрын
Awesome 😁😁
@bh45412 жыл бұрын
why O(n*k) can someone explain for me ?: thank u
@osamaayman37652 жыл бұрын
Because the for-loop loops over all the input string of length n and in each iteration we are creating a substring of length k (which takes linear time because it copies all chars to a new string). So, the overall time complexity is O(n*k).