palindromes were tricky until I learned this

preview_player
Показать описание


#coding #leetcode #python
Рекомендации по теме
Комментарии
Автор

I reviewed this question a few times a week ago and this video made me realize that I’ve already forgotten everything

osjjsm
Автор

Two pointers

A go to solution for palindrome problems

codecompass
Автор

I remember grinding so many leetcode last year, and now I haven't touched the site in over 4-5 months. While I remember all the logic and basic implementation of algorithms, I no longer remember how to adjust them to solve given problems anymore. Might be time to start again

coolkaw
Автор

I jst did this code.... Nd thought taking a break...opened utube and this short popped up😂

aiml__sourikpoddar
Автор

The part of the solution that I struggle with understanding is the if statement. How to think about this r - l + 1 is really baffling to me

hookedonphones
Автор

Nice. At the cost of code clarity, you could be slightly more efficient by iterating from the center to the ends, since you can stop iterating once the available space is no longer sufficient to contain a longer result.

DCTOR-ZED
Автор

The best language for palindromes is definitely Spanish

illogicmath
Автор

Thanks mate! You're really good at this.

stevedoolan
Автор

Start from the middle and search for both odd and even.
Thanks Nav, I still remember the trick you taught us.

shuvbhowmickbestin
Автор

Thank you for your videos! They are great. But could you explain Manacher's algorithm that can solve this problem in O(N)? That would be a great video)

mra-fx
Автор

When I first saw this problem I thought storing indexes of a character in a dictionary for char and a list, then check chars if there's a list of indexes then check string fr the first to the highest index if it's palindrome. Now seeing this made me realise that I am stupid

osys
Автор

I'm just a tradesman who has zero idea how to code but this is pretty neat

SpidermansSymbiote
Автор

The “L” and number “1” are throwing me off lol.

yesjohnsoncan
Автор

if it's a palindrome wouldn't it be easier to get the length and if it's odd, divide the that number by 2 add 1 and remove that letter, then just do the normal palindrome procedure

OozyGoozyNFT
Автор

Why cant we do two pointers starting outwards?

abserooni
Автор

What's the point of the if statement "if (r - l + 1) > resLen:"

jeevanprakash
Автор

Jobs want this type of thought but most of what is done is ETL work.

YoungGrizzly
Автор

Bro forgot to explain manacher algorithm 💀

fergalhennessy
Автор

There is a much simplier solution to this

arphenti
Автор

this problem scared me by reading it. but in was so lucky that i encountered greedy to pick up that it maybe was't as bad as it could of been.

MerrowGula