Valid Palindrome II

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Dude. The number of leetocde solutions without explanations, but you took the time and effort to elaborate it out. You definitely deserve the best career possible. I am 10 years in the field and its rare to find people like you.

vcfirefox
Автор

Runtime is too strict, and edge cases are too annoying for this to be an "easy" problem.

TheElementFive
Автор

Awesome explanation, even without knowing Java you make these questions super easy to understand 🙏

asherintech
Автор

Whenever you say "pretty simple problem" I feel bad because to me it´s really hard (even though leetcode says "easy") I need more practice.

GustavoDiaz
Автор

I like the way you approach the problems.

gokul
Автор

Awesome explanation are on next level 🔥🔥🔥🔥

jayakumarm
Автор

Thank you for such a nice explaination

AmolGautam
Автор

I was recently asked the spiral matrix question in the first round of my Facebook interview. Somehow managed to implement it.

siddhantmisra
Автор

Kevin, thanks for the great videos. I don't have Java experience, but I've been watching all your stuff because you explain in such an understandable way. You've surely been through hundreds of these problems, do you often run into a question that leaves you stumped for a bit? It would be interesting to see you code through a difficult problem for the first time.


Question on prep vs. interview... when working through problems on LeetCode, I usually start small and keep iterating and executing/testing the code until i reach a satisfactory solution. Should the goal be to instead think through the problem and code the solution all in one go?

drteeth
Автор

I don't think it is O(n) complexity. Looks like O(n^2) beacuse of nested while loops for the worst case. If the input string is already a valid palindrome then it will be O(n).
If we don't make a isPalindrome function and put 2 while loops directly inside the top while loop then internal 2 while loops will be O(2n) and with outer while loop it will become O(n^2).
Please correct me if this logic is wrong.

NishankSingla
Автор

Bro i know u probably have other important things to do but can u pls make more videos quickly?i love the way u explain and want to learn more from u..maybe make 2-3 videos a day? Xd

TrollFreeInternet
Автор

I was asked this question in Facebook interview.

harigovind
Автор

Kevin .. thank you for all the wonderful videos.

I was wondering if just keeping a counter on the first while loop would suffice and if the counter goes over 1 then you can return a false instead of creating another method for checking the substring for a palindrome

Yetsofaraway
Автор

Nice vid but im a bit confused, how does the helper method work for the inner 2 indexes? Wouldnt the indexes overlap and not not beyond the while loop?

atift
Автор

I'm having trouble solving the problem 1172. Dinner Plate Stacks from Leetcode. I don't really understand the explanation in CTCI either. A video regarding this would be much appreciated. I've spent a fair bit of time with this problem. The methods I'm having trouble with are leftShift and specially join, if you check the CTCI implementation. Thanks!

freefortravel
Автор

Seems to be timing out for me, isn't it O(n^2) and not O(n) ?

marksaunders
Автор

very cool explanation! I was unnecessarily doing recursion in my helper function! This is better :)

madhuravp
Автор

Thanks for helping us with these coding interviews. I have to take a part 2 - Amazon Full-Time SDE Assessment by this Friday. Would you give me any advice before I take it?

alanchavez
Автор

You might wanna try using a whiteboard to explain stuff.

MP-nyep
Автор

its failed for input s="cbbcc"

divitvivit