Count Ways To Build Good Strings - Leetcode 2466 - Python

  Рет қаралды 7,515

NeetCodeIO

NeetCodeIO

Күн бұрын

Пікірлер
@user-my6yf1st8z
@user-my6yf1st8z 3 күн бұрын
thanks boss, 100% should be reuploaded. People need this.
@adilansari-hq9ge
@adilansari-hq9ge 3 күн бұрын
Any Video which has been recored 2 years back, you must re-record and reupload . The Reason , Your teacing style has improved a lot in past years. When I watch old videos , i find new videos are much much better. Please increase the font size of Code Editor. Love you bro , Keep recording and teaching.
@theLowestPointInMyLife
@theLowestPointInMyLife 2 күн бұрын
whats the point, unless you are in india
@ceciljoel9577
@ceciljoel9577 2 күн бұрын
I leanrnt dynammic programming thanks to you your teaching is exceptional
@SarweshParsewar
@SarweshParsewar 2 күн бұрын
Would really appreciate if you start posting contest solutions for problem 3 and 4 coz they are unique sometimes
@chaitanyayeole4111
@chaitanyayeole4111 2 күн бұрын
Do not reupload if there is no better solution or explaination, but if you have a better approach to the same solution, please upload a new video. You can post an KZbin story or post to the link of the video.
@EranM
@EranM 3 күн бұрын
just one thing in 15:15, you don't need the list comprehension brackets, you can just use the sum() brackets which calculates it as a generated object
@n-logn
@n-logn 2 күн бұрын
Thanks neetcode , I am currently following neetcode 150 and i was able to solve this question on my own after solving n150's dp section.
@prajwals8203
@prajwals8203 3 күн бұрын
Wow to think there was a time NC did not use defaultdicts
@quaiwentt6156
@quaiwentt6156 3 күн бұрын
why doesn't it work to do the modulo to the answer after computing the entire answer? like return dfs(0) % (10 ** 9 + 7)? I tried it that way and got memory limit exceeded. why do you have to mod it inside the dfs function?
@PranayCh
@PranayCh 3 күн бұрын
Check this it works: class Solution: def countGoodStrings(self, low: int, high: int, zero: int, one: int) -> int: def solve(i,low,high,zer,on,dp): if i>high: return 0 if dp[i]!=-1: return dp[i] ans=0 if i>=low and i
@arjunprasad1071
@arjunprasad1071 2 күн бұрын
Modulo is taken inside the dfs so as to keep the intermediate recursive dfs results in bounds. Applying the modulo operation during the recursive computation ensures that the intermediate results stay within a manageable range, specifically [0, MOD - 1], where MOD is typically 10^9+7.
@andreyvasilev527
@andreyvasilev527 3 күн бұрын
Thank you so much! You are a Legend!
@EvelynNguyen-ei9tj
@EvelynNguyen-ei9tj 3 күн бұрын
Big fan of you ! 🎉
@sauravsingh4497
@sauravsingh4497 2 күн бұрын
Can someone tell me what if start our DFS from low and not check for >=low condition will it work ?it's not working I don't know what logical error I am making
@yhbarve
@yhbarve 3 күн бұрын
Get in there!
@VanjeAv
@VanjeAv 3 күн бұрын
The upload is cool with a small intro thanks
@tejuju
@tejuju Күн бұрын
Agree for me to upload again repetitive questions, as the most actual ones have translation to my language :) thx
@DebopriyoBasu
@DebopriyoBasu 3 күн бұрын
Hey Neetcode, is there any Purchasing Power Parity provided for low income countries while purchasing Neetcode Pro?
@KoreaCulture-eg9xh
@KoreaCulture-eg9xh 3 күн бұрын
Great question
@KoreaCulture-eg9xh
@KoreaCulture-eg9xh 3 күн бұрын
@NeetCodeIO
@NeetCodeIO
@NeetCodeIO 2 күн бұрын
Yes I recently added it, it's 50% off for some countries
@DebopriyoBasu
@DebopriyoBasu 2 күн бұрын
@@NeetCodeIO Is India In the list? Do we need to add some special coupon code in the payment page?
@Pontiff03
@Pontiff03 2 күн бұрын
How much time did it took to come up with a solution like this.
@JamesBond-mq7pd
@JamesBond-mq7pd 3 күн бұрын
why in DP we need to mod dp[i]??
@SarweshParsewar
@SarweshParsewar 2 күн бұрын
problem statement states that to return with modulo applied
@antm9957
@antm9957 2 күн бұрын
I don't understand why dp = {0: 1}. Does this mean that there is 1 way to get an empty string from a string of length zero and a string of length one? According to the condition, zero > 0 and one > 0. What is this one way? Is it the way of 'NOT TAKING zero and NOT TAKING one'? Or what? I don't understand how to handle the base case.
@arjunprasad1071
@arjunprasad1071 2 күн бұрын
The conditions zero > 0 and one > 0 means that you must append at least one '0' or atleast one '1' to create a valid good string. However, this base case does not imply that we are creating valid strings at this point , it is to establish the starting point of DP logic. dp[x] typically represents the number of ways to construct a good string of length x. Therefore, dp[0] = 1 means that there is exactly 1 way to construct an empty string (a string of length 0).
@PedanticAnswerSeeker
@PedanticAnswerSeeker 2 күн бұрын
Please do a redo of it though. I want to see a fresh take please
@e_sumit
@e_sumit 3 күн бұрын
before seen your face, i thought there is a foreigner behind the screen :D, nice to see you.
@teccs6353
@teccs6353 2 күн бұрын
The re-uploaded video is fine but is it not missing the time and space complexity that you typically do at the end of the video? I find Big O analysis hard when the problem doesn't easily map onto something I am familiar with so having this to build more intuition on top of would be very helpful. I would say only reupload if the video contains the base necessities that are present in all of your recent videos, primarily: 1. explanation & problem reading 2. implementation 3. "coding it up" 4. retrospection and complexity analysis Thank you for all of your videos and insight, they are tremendously helpful.
@Nonsense116
@Nonsense116 3 күн бұрын
I like your new speaking cadence a lot more
@Hoppitot
@Hoppitot 2 күн бұрын
Bruh I basically cleared 80% of neetcode 150 and now we get the less painful version hahaha
@jnic8845
@jnic8845 3 күн бұрын
I like when you upload because I see it straight away in my recommended, but if its a bit of a hassle to reupload, then it's totally unnecessary to do this. Also I would love to see recent weekly contest questions solved by you. I feel that some of the questions can be quite interesting and worth an upload.
@qsvui
@qsvui 3 күн бұрын
why reupload? anyone searching youtube for leetcode 2466 will see your old video
@NeetCodeIO
@NeetCodeIO 3 күн бұрын
Most people don't search unfortunately, they think I skipped the problem from yesterday
@KoreaCulture-eg9xh
@KoreaCulture-eg9xh 3 күн бұрын
@@NeetCodeIO could you reply to @DebopriyoBasu
@AjayKumar-gs9sg
@AjayKumar-gs9sg 3 күн бұрын
How could you solve it and make video in 29 mins ?
@yang5843
@yang5843 3 күн бұрын
Leetcode creates editorials of problems ahead of time
@joeAnon796
@joeAnon796 3 күн бұрын
He solved this already. I just finished watching the video from last year lol
@AjayKumar-gs9sg
@AjayKumar-gs9sg 3 күн бұрын
​@@yang5843 what's your leetcode username ? Mine is Ajaykumarunt
@AjayKumar-gs9sg
@AjayKumar-gs9sg 3 күн бұрын
​@@joeAnon796what's your leetcode username? Mine is Ajaykumarunt
@NeetCodeIO
@NeetCodeIO 3 күн бұрын
This one I made May 2023
@mohamedsayed8697
@mohamedsayed8697 3 күн бұрын
Off topic, but I miss LeetCode's old UI and the dislike counter.
@kamilrudny1884
@kamilrudny1884 2 күн бұрын
theres no sense in reuploading the same content. If someone is able to do leetcode, it should be trivial for them to search for solution on this channel. More spam and work for you than profit
@STYLESY673
@STYLESY673 3 күн бұрын
I appreciate your website and videos so much, thank you for everything you do 🤍
Minimum Cost For Tickets - Leetcode 983 - Python
22:46
NeetCodeIO
Рет қаралды 6 М.
Replace Is Number Saves 440GB A WEEK
9:54
ThePrimeagenClips
Рет қаралды 362 М.
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
Count Vowel Strings in Ranges - Leetcode 2559 - Python
11:27
NeetCodeIO
Рет қаралды 1,9 М.
Python laid waste to my C++!
17:18
Sheafification of G
Рет қаралды 175 М.
Software Engineers have no Deep Knowledge now?
8:54
Roman V.
Рет қаралды 3 М.
How I Mastered Data Structures and Algorithms in 8 Weeks
15:46
Aman Manazir
Рет қаралды 140 М.
it's time for a change
6:26
ThePrimeTime
Рет қаралды 151 М.
"Junior developers can't think anymore..."
13:53
Travis Media
Рет қаралды 44 М.
What P vs NP is actually about
17:58
Polylog
Рет қаралды 143 М.
Why Your Backend Shouldn't Serve Files
19:40
Boot dev
Рет қаралды 44 М.
4 Steps to Solve Any Dynamic Programming (DP) Problem
0:57
Greg Hogg
Рет қаралды 482 М.