Longest Palindromic Substring | Recursion | Memoization | Microsoft | Leetcode 5 | codestorywithMIK

preview_player
Показать описание
This is the 72nd Video on our Dynamic Programming (DP) Playlist.
In this video we will try to solve a very good DP Problem - Longest Palindromic Substring (Leetcode-5).
I will explain :
1. Basic Recursion + Memo
2. Accepted without Memoization as well.

I will explain the intuition so easily that you will never forget and start seeing this as cakewalk EASYYY.
We will do live coding after explanation and see if we are able to pass all the test cases.

Problem Name : Longest Palindromic Substring
Company Tags : Accolite, Amazon, Groupon, MakeMyTrip, Microsoft, Qualcomm, Samsung, Visa, Walmart, Zoho

╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣
╠╗║╚╝║║╠╗║╚╣║║║║║═╣
╚═╩══╩═╩═╩═╩╝╚╩═╩═╝

#coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge#leetcodequestions #leetcodechallenge #hindi #india #hindiexplanation #hindiexplained #easyexplaination #interview#interviewtips #interviewpreparation #interview_ds_algo #hinglish #github #design #data #google #video #instagram #facebook
Комментарии
Автор

The Most Underrated DSA tutor . Hats OFF bhai .
Keep Doing . We all are Thankful .

santoshpathak
Автор

everybody can solve the Question but what you do is called teaching
extremly Helpful

harshitgoyal
Автор

I knew I would get recur+memo from you only. Couldn't find a single video on recursion+memo for this problem. Thanks a lot

wearevacationuncoverers
Автор

approach is genuis man! everyone talks about the same old tabulation approach for this....literally nobody talks about memoization

Asdfdyutgfd
Автор

"You've just performed a graceful postmortem on the question, offering a clear, straightforward, and logical analysis. Your ability to distill complex ideas into an easily digestible narrative showcases your remarkable skill for simplification and clarity.

mohdalizilani
Автор

Unique solution.... loved your approach....i was looking for this kind of approach only since other solutions were not that intuitive

devsharma
Автор

Fantastic video and approach dude! I was getting MLE again and again, thus, today I really got insight about how interesting such tiny details (in this case, pass by reference ) in programming are. Thanks man!

atharvpal
Автор

Thanks for the clear explanation. Memorization might not be necessary here because there's no chance of problems overlapping. In simple terms, the solve function calls itself only once.

bsratuoh
Автор

i have no words for u gentleman, just loved ur cool concept waoo wonderfull just learnt it in one flow, i was really distracted by this question solution trying 3rd day by ur video and finally i have learn the algo thanku so much

ankit_yadav
Автор

Linked this explanation so much that I liked the video from all my accounts❤👍

manimanohar_
Автор

I approached the problem by finding the longest possible palindrome for taking every character of the original string as middlemost character of the longest possible palindrome and finding the length of the palindrome, whilst updating the maxlength so far and the middlemost index.

rabeakhatun
Автор

Very good man. Method of teaching is awesome.

qRpKsJt
Автор

Bro after submitting this code here shown me memory limit exceeded..what can i do..?

PabitraT
Автор

Unbelievable explanation
Thanks sir ❣️❣️❣️
Keep it up
Upload more video solution on leetcode questions

tusharsingh
Автор

sir you explain next level
but i have question how this logic click on your mind why i can't able to solve new problem please give me some tips ?

neerajchopra
Автор

great video, thanks for the explanation

UchihaItachi-plun
Автор

I really loved your way of explaining. I am quite new at DSA. Can you please tell me the best way to utilize your videos to learn dsa. Which order I should watch.

kamoleshroy
Автор

class Solution {
public String longestPalindrome (String s){
String ans=s.substring (0, 1);
String curPal;
for(int i=0;i<n;i++){
curPal =getPal (s, i, i);
ans=curPal.length ()>ans.length()?curPal:ans;
curPal =getPal (s, i, i+1);
ans=curPal.length ()>ans.length ()?curPal:ans;
}
}
return ans;
}
private String getPal (String s, int start, int end){
while (start
start--;end++;
}
return s.substring (start +1, end);
}
}
please explain manchar algorithm. manchar algorithm tc=0(n);
🎉❤

dayashankarlakhotia
Автор

A very nice and concise explaination bhaiya 💙

_ayush_oswal
Автор

Isn't Time Complexity O(n^2) ?
Bcz isPalindrome runs for only O(n) for entire for loop so it should be O(n^2) + O(n) = O(n^2) ?
Ammortized to O(1) by using dp ?

devkumar