I spent the entire evening trying to understand this algorithm, and your video was a great help. Thank you so much!
@ThinkFWDАй бұрын
Thank you!
@RichardYoung114 жыл бұрын
I'm currently working through the Blind 75 Leetcode list, and I find your videos to be super helpful! Most explanations I find are in Java or Python, and it's great to see some JavaScript solutions. Personally, I like the background music. It's like watching a relaxing Twitch stream. Please keep it up!
@ThinkFWD4 жыл бұрын
Richard Young thanks man! I might bring back some soothing background music
@MarcRacho4 жыл бұрын
Ok, this confused me a lot lol but I did some more reading about the algorithm, plus actually running the algorithm on paper, tracking every variable, helped a lot. I have never heard of Manacher algorithm until this video. Thanks again, bro!
@ThinkFWD4 жыл бұрын
please feel free to recommend a question for next eps !
@meeravalinawab93724 жыл бұрын
Bro you are best in explaining things bro love this video. Searching for this actually messed my interview because of this algorithm
@meeravalinawab93724 жыл бұрын
Can you explain Tim sort bro . it will be helpful for cp.
@techmadehere4 жыл бұрын
KMP
@khandakermushfiqurrahman51174 жыл бұрын
Thank you for this great explanation. I learned the algorithm from you. Here is my python3 solution: (it got faster than 92% solutions status. not 100% . not sure why though) def preprocessString(s:str): l=len(s) retStr = [None]*(l*2+1) retStr[0]="#" j=1 for i in range(l): retStr[j]=s[i] retStr[j+1]="#" j+=2 return retStr class Solution: def longestPalindrome(self,s: str) -> str: ppStr=preprocessString(s) lenCount=[0]*len(ppStr) if len(s)
@ThinkFWD4 жыл бұрын
Well 92% is still fantastic. Sometimes Leetcode isn't the most accurate measure of %. It really depends on the server latency and how many people are hitting it at once. You can actually submit the same code again and get different specs. What i like to do is actually take an avg or at least your in the top percentile. The more important part is to understand the algorithm and not focus too much on the % etc. :) in real life, you have other ways to measure performance.
@RoundAboutMk4 жыл бұрын
In my opinion, this is the best explanation of this algorithm on the internet. Thank you very much
@ThinkFWD4 жыл бұрын
Thank you for the positive feedback!
@sakthim71603 жыл бұрын
you have really explained well. Thank you.
@rajhpking4 жыл бұрын
No need of background music. For me it is really disturbing and I am not able to concentrate what you are explaining. Plz take off it.
@ThinkFWD4 жыл бұрын
Parag thanks I’ll note that for next video and keep it out :)
@MrMaxKey4 жыл бұрын
good demo but unfortunately no explanation why the algorithm works
@shubhamholkar83965 ай бұрын
In an interview, I can do this and then try to optimize right. This is without knowing that algo. I just want to know if it is good as the first solution in the interview and then try to optimize it??? var longestPalindrome = function(s) { const split = s.split('').join('$').split('') const aa= s.split('') if(aa.reverse().join('')===s){ return s } if(s.length===2){ if(s[0]===s[1]){ return s } else{ return s[0] } } let longPal=s[0] for(let i =0; i{ while(arr[left] === arr[right] ){ left = left -1 right = right +1 } return { left, right} }
@techmadehere4 жыл бұрын
It was nice
@ThinkFWD4 жыл бұрын
Nimish Agrawal thanks !
@MrZiyak994 жыл бұрын
why let right = i + (P[i] + 1) let left = i - (P[i] + 1) instead of let right = i + 1 let left = i - 1
@Ki1ngOfGods2 жыл бұрын
As much as I wanted to understand this problem from different videos, I just couldn't. If I'm not mistaken isn't this O(n2)? Any simpler shorter way of solving it?
@nbf70043 жыл бұрын
not a great explanation. didn't explain how the algorithm works.
@DMWestWoodElite4 жыл бұрын
I was able to solve the leetcode problem in python using this video, i still don't really understand the algorithm though.
@parthpatel-dg3db4 жыл бұрын
Great Video. I liked it. But I am in doubt that It won't work for the string "ababababababa". Please try it out.
@karolrvn3 жыл бұрын
need more visible (bigger) mouse pointer
@Gel10984 жыл бұрын
@10:31 Why not 1 or 3 = (10-7)?
@ThinkFWD4 жыл бұрын
gel drif great find! Apparently I cannot do mental math, you are correct it should be minimum of 1 or 3. The solution doesn’t change but what I mention (2) is incorrect.