I am not well guys . Having bad throat and fever. Hope my voice sounds fine in the video. Thank you all for the support and love ❤❤ iPAD PDF NOTES - github.com/MAZHARMIK/Interview_DS_Algo/blob/master/iPad%20PDF%20Notes/Leetcode-647-Palindromic%20Substrings.pdf
02:36 Brute Force without memoization 10:12 Brute Force with memoization 18:02 Dynamic Programming - Bottom Up Approach 45:06 Expanding from midpoint of palindrome for Even and Odd length palindrom(Smart Approach)
man i solved this with 3 approaches before coming here, 1. bruteforce without memoization : O(n^3) time and O(1) space 2. bruteforce with memoization: O(n^2) time and O(n^2) space 3. expanding sideways from mid point approach : O(n^2) and O(1) space im bad in dp so, i tried looking online to understand but i didnt understand any approach . Yours dp explanation with bottom up approach somewhat made sense. Also, there is a algo called - manacher algo(got to know from chatgpt suggestions on how to improve the solution better). Maybe you can create another video on how to solve using that one. I would suggest you to put i time frames in your video mentioning just Approach 1 from xx:xx to yy:yy. this helps to navigate easily. AND thanks man!
Bro brute force with memo shouldn't be greater than O(n^2) as we r calculating wether a substring is palindrome or not once for every substring aren't we? @codestorywithMIK
@@DManikandan-cw2cw bro worst case possibility when doing memoization can have o(n*n) substrings in the storage . Hence o(n^2) space. Open to discuss , correct me if I’m wrong !!
Bhai aapki videos ko dekhke to aisa lagta hai ki agar agle 3-4 mahine me maine koi job nhi crack ki to competition aasmaan me pahunch jayega. Aap jaisa padhate ho koi mechanical wala bhi 3 mahine me coder ban jaye.. :)
i think you are mistaking the brute force with memo, the memo only gonna send its prestored value for the case when the sub sting has repeated characters. like for "kkkkk" memo is useful, but for "aback" momo never work, not even in the case of "abba" memo work. i have varified then by just cout before returning the memo value
I didn't get the time complexity for the brute and recursive . I'm considering it like this that i and j goes for every substring that exists in the string right? and then isPalinChecker basically iterates through the length of the substring . Total no of substring = n*(n+1)/2 and lets say the avg length of each substring is M then won't the tc be O(N^2 * M) and also if we memoize it we will just reduce M not technically eliminate it So its better than cubic but we can't call it totally to be a n squared.
Sir is it possible for you to start a small cohort for DSA as i'm looking to learning from you as from you i learnt a lot and want to learn more with you.
There are many palindromes hidden in the string. And each character can be the center of those palindromes. There can be even length palindromes and odd length palindromes. For even length a single character can’t be the centre and hence need to consider with its adjacent (i+1) character to become centre of palindrome and try expanding. For odd length, every character can try to become centre and expand to see palindromes.
Good video, but it could have been better if u would have explained string hashing algo solution too😅. This is a reference video czcams.com/video/1thnThrIzwg/video.htmlsi=ynn040ejMQx96CVt Very long video but recommended if u have time 👍
@@xiaoshen194 how is it n^3 the palin check functoin doesn't necessarily iterates through the whole string it just goes for the length of the substring . Can you please explain
Thank you for that! I was frustrated when I discovered that your video, the third one I clicked on, was in a language other than English. Despite this, I wish you all the best, and I hope you consider explaining the problems in English to connect with a broader audience@@codestorywithMIK
MIK, your breakdown of this question is like having four unique flavors in a delicious explanation! Excellent job in making it clear and easy to understand. 🦸
I am not well guys . Having bad throat and fever.
Hope my voice sounds fine in the video.
Thank you all for the support and love ❤❤
iPAD PDF NOTES - github.com/MAZHARMIK/Interview_DS_Algo/blob/master/iPad%20PDF%20Notes/Leetcode-647-Palindromic%20Substrings.pdf
U r as usual rock ❤🚒🔥
@codestorywithMIK can u teach greedy. can u start a series!!
take care bhaiya !! ur way of explaining the problems are so good that coding has now become a habit
Take care king
Hope u have a speedy recovery💖💖
This easily beats any paid course available on market.
You are making DP concepts so easy for people like me who always had fear of DP😊
02:36 Brute Force without memoization
10:12 Brute Force with memoization
18:02 Dynamic Programming - Bottom Up Approach
45:06 Expanding from midpoint of palindrome for Even and Odd length palindrom(Smart Approach)
❤️❤️❤️🙏🙏🙏
I dontt know whether you will be reading this comment or not but let me tell you that your teaching style and effor are commendable
It means a lot. Thank you for your kind words ❤️🙏
Accha samjhaya, mujhe 4th solution mast laga.
Space complexity O(n^2) se direct O(1).
3rd approach boht mast lagi, 4th bhi thik hai 🙂🙂
Brother your way of speaking and explaining is really beautiful, wish you the best
Goodness. The quality of the explanation is just 🔥
clean and clear explanation. Thank you so much for the video.wish you a speedy recovery.
man i solved this with 3 approaches before coming here,
1. bruteforce without memoization : O(n^3) time and O(1) space
2. bruteforce with memoization: O(n^2) time and O(n^2) space
3. expanding sideways from mid point approach : O(n^2) and O(1) space
im bad in dp so, i tried looking online to understand but i didnt understand any approach . Yours dp explanation with bottom up approach somewhat made sense.
Also, there is a algo called - manacher algo(got to know from chatgpt suggestions on how to improve the solution better). Maybe you can create another video on how to solve using that one.
I would suggest you to put i time frames in your video mentioning just Approach 1 from xx:xx to yy:yy. this helps to navigate easily. AND thanks man!
Bro brute force with memo shouldn't be greater than O(n^2) as we r calculating wether a substring is palindrome or not once for every substring aren't we?
@codestorywithMIK
@@DManikandan-cw2cw bro worst case possibility when doing memoization can have o(n*n) substrings in the storage . Hence o(n^2) space. Open to discuss , correct me if I’m wrong !!
Good explanation blueprints is most important. i have see first time this blueprints in ytube thanks for 18k+ subscription 🎉
Bhai aapki videos ko dekhke to aisa lagta hai ki agar agle 3-4 mahine me maine koi job nhi crack ki to competition aasmaan me pahunch jayega. Aap jaisa padhate ho koi mechanical wala bhi 3 mahine me coder ban jaye.. :)
Omg bhaii iss level ki dedication se explain krna iss so inspirational ❤❤❤❤❤ thanks a lot, don't have enough words to thank you
That's what we call quality Content!
We can simplify the conditional statements in the bottom up approach:
if s[i] == s[j] and (l
Perfect 👍🏻👌
Hats off to the level of explanation mik. You are just nailing it.
get well soon sir...
Can you make videos on GFG PODT too? It's great help if you can.
Great video. I wanted to request if you could list problems that can be solved using the blueprint you mentioned. I wanted to test it out. Thanks !
Great Video, Great Explanation!! Could follow whole video with intrest.
Content on fire 💥💥
All solutions explained!! op
Awesome and my one stop solution as always.
Amazing explanation ❤
Chummesawari video😘
pls mature bano
Thank you so much for the blueprint ❤
Thank you so much bhaiya.... get well soon
thnx bro for such detailed explaination
POTD DONE [10.2.24] ✅✅
Is the approach 4 is called as Manacher's algorithm?
i think you are mistaking the brute force with memo, the memo only gonna send its prestored value for the case when the sub sting has repeated characters.
like for "kkkkk" memo is useful, but for "aback" momo never work, not even in the case of "abba" memo work.
i have varified then by just cout before returning the memo value
brother what will be the time complexity of blue print code
I didn't get the time complexity for the brute and recursive . I'm considering it like this that i and j goes for every substring that exists in the string right? and then isPalinChecker basically iterates through the length of the substring . Total no of substring = n*(n+1)/2 and lets say the avg length of each substring is M then won't the tc be O(N^2 * M) and also if we memoize it we will just reduce M not technically eliminate it So its better than cubic but we can't call it totally to be a n squared.
Me solving LC daily with one approach
Meanwhile MIK coming up with 4 approaches 🗿
Thanks a lot bhaiya for the god level explanation ❤❤
Sir approach 3 is gap method?
bhaiya hum substring recursion ke through nhi nikal sakte kya
@codestorywithMIK
what is the time complexity of 4th approach?
It’s O(n^2) because we are running for loop for picking each character i
Then for each one of them you are trying to expand.
Sir is it possible for you to start a small cohort for DSA as i'm looking to learning from you as from you i learnt a lot and want to learn more with you.
Hi Ankit,
Can you elaborate what’s cohort ?
Sorry I am not aware of this term 😅
@@codestorywithMIK it's like taking at max 100 people and teach them and guide them personally.
I see.
Let me try to make a plan for that soon.
@@codestorywithMIK yes sir please consider it. It will be very helpful for someone like me.
@Ankitkumar-fz3kc definitely ❤️❤️
Bhai ye first solution ka on³ hona chaiye na n² kese
Great Bhai🔥🔥
Is it okay to not being able to solve this problem even after solving 30-40 problems on DP? 😭
That’s totally fine. Don’t worry. Keep practising, slowly and steadily you will be able to win this
worst case ~10^9 o(n^3) please tell me how it is possible without showing TLE.
It seems Leetcode had weak test cases
sir please arrange your dp videos in difficulty order bhaiya
sir please check if java 2nd approach if its working?
I have updated it. Kindly check ❤️🙏😇
❤❤❤
Hi Mik 4th approach ai confusion hai , har character ke liye odd adn even length kyu le rhe hai ?
There are many palindromes hidden in the string. And each character can be the center of those palindromes. There can be even length palindromes and odd length palindromes.
For even length a single character can’t be the centre and hence need to consider with its adjacent (i+1) character to become centre of palindrome and try expanding.
For odd length, every character can try to become centre and expand to see palindromes.
for the 3rd approach why i can not write loop like normal i to n and j = i to n ie. for (int i = 0 ; i
❣
Good video, but it could have been better if u would have explained string hashing algo solution too😅. This is a reference video czcams.com/video/1thnThrIzwg/video.htmlsi=ynn040ejMQx96CVt
Very long video but recommended if u have time 👍
Wait r we gonna ignore the fact that an O(n³) solution passed with max(n) = 1000? Test cases not set properly...
@@xiaoshen194 how is it n^3 the palin check functoin doesn't necessarily iterates through the whole string it just goes for the length of the substring . Can you please explain
@@ritishrai581 length of subs can be O(n) in worst case
respect
Bhai Thora Chhota video banaya kro, itne lambe video time waste krte hai , main intuition de Diya kro starting me , fir continue kro apna Gyan.
i don't understand, if the video in hindi or other language, mention it in title so you will not waste people's time!
I apologise for the inconvenience.
I will take care of it
Thank you for that!
I was frustrated when I discovered that your video, the third one I clicked on, was in a language other than English.
Despite this, I wish you all the best, and I hope you consider explaining the problems in English to connect with a broader audience@@codestorywithMIK
Definitely. I will try to make English videos soon.
Thank you for your precious suggestions ❤️
MIK, your breakdown of this question is like having four unique flavors in a delicious explanation! Excellent job in making it clear and easy to understand. 🦸
❤❤
❤❤❤