Don't worry, papa neetcode is here Btw I recently launched a course where you can learn Postgres with 75 interactive lessons. Writing code is the best way to learn and neetcode.io makes that easy for you do to. NC Pro members automatically have access to all courses.
Thank you so much for making these videos, I started learning to program this year and was at the point where code just looked like magic, but now I can follow along and have a good idea of how you’ll implement the code! Youre the man
I didn't quite get why substr had to be removed from cur_set after dfs call. Doesn't that defeat the whole purpose of finding duplicates? Can someone please explain?
bro because when u backtrack u go back to a state where u haven’t seen it before like yeah u might have made the choice for substring “ab” but after u made that choice and backtrack u need to remove the rest of what u have seen after exploring it because u r at new state
HELP ME Please! I have no clue at all why the following does not work. Fails for the input "wwwzfvedwfvhsww" def maxUniqueSplit(self, s: str) -> int: if len(s) == 1: return 1 counter = set() def helper(start, end): if end > len(s): return 0 if start == len(s): return 0 curr_string = s[start:end] if curr_string in counter: return 0 counter.add(curr_string) does_end = 1 + helper(end, end+1) counter.remove(curr_string) doesnot_end = helper(start, end + 1) return max(doesnot_end, does_end) return helper(0, 1)
Don't worry, papa neetcode is here
Btw I recently launched a course where you can learn Postgres with 75 interactive lessons. Writing code is the best way to learn and neetcode.io makes that easy for you do to. NC Pro members automatically have access to all courses.
Just last week went from a 100k to a 240k SWE job because of these videos. Thanks for everything you do papa neetcode
2 Highlights of the video:
1:00 "papa neetcode" 🫶
1:08 voice crack 🤡
Jk great video as usual, just got an excuse to comment lol
My voice cracks a lot I usually edit it out 🫠
Thank you so much for making these videos, I started learning to program this year and was at the point where code just looked like magic, but now I can follow along and have a good idea of how you’ll implement the code! Youre the man
You can remove the substr by maintaining a str variable, and appending a char at every iteration for the loop.
Beautiful explanation. Thank you !
I went for the greedy approach first :(((((((
Anyways, thank you Neetcode!
Hearing "papa neetcode" was not on my bingo list 😭
could you start giving an alternative dry run of codes in java and c++ too?
I didn't quite get why substr had to be removed from cur_set after dfs call. Doesn't that defeat the whole purpose of finding duplicates? Can someone please explain?
bro because when u backtrack u go back to a state where u haven’t seen it before like yeah u might have made the choice for substring “ab” but after u made that choice and backtrack u need to remove the rest of what u have seen after exploring it because u r at new state
thanks for help papa. needed it for that daily streak (hehe my name also Daley)
Nice..
Why are you slicing substr in every iteration in the loop?
HELP ME Please! I have no clue at all why the following does not work. Fails for the input "wwwzfvedwfvhsww"
def maxUniqueSplit(self, s: str) -> int:
if len(s) == 1:
return 1
counter = set()
def helper(start, end):
if end > len(s):
return 0
if start == len(s):
return 0
curr_string = s[start:end]
if curr_string in counter:
return 0
counter.add(curr_string)
does_end = 1 + helper(end, end+1)
counter.remove(curr_string)
doesnot_end = helper(start, end + 1)
return max(doesnot_end, does_end)
return helper(0, 1)
Papá ❤
papa neetcode