Тёмный

214.Shortest Palindrome || Leetcode || Solved&Explained || C++ 

Aanchal Jain
Подписаться 87
Просмотров 9 тыс.
50% 1

Solved a problem from leetcode.
Problem Name:Shortest Palindrome
Level:Hard
Link to the problem: leetcode.com/p...
Recommended: Watch it on 1.75x or 2x.

Опубликовано:

 

20 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 35   
@shikharai-tl4vb
@shikharai-tl4vb День назад
you tried well Understanding a problem and effectively explaining it to others are two entirely different skills.
@eklavyacodinghub
@eklavyacodinghub 18 часов назад
thanks ma'am for making this concept so easy
@unclezee7369
@unclezee7369 26 дней назад
Best explanation so far
@avneedadhich9185
@avneedadhich9185 Год назад
My search for it's solution finally came to an end . Thanks for such a great explanation .
@anonymoustrolls7952
@anonymoustrolls7952 День назад
she just taught KMP, good explanation
@soumya_suman
@soumya_suman 17 часов назад
Thank You !!!
@satyamaditya384
@satyamaditya384 Месяц назад
Thank you ma'am for such a great explanation, I had been struggling with KMP too, but now concepts are crystal clear. Thanks a lot!!!
@materialscience8301
@materialscience8301 Год назад
thanks for make it. your explanation is very well 😊😊 i hope you will continue ..& grow
@aanchaljain4610
@aanchaljain4610 Год назад
sure!thank you
@abhishekverma7604
@abhishekverma7604 11 месяцев назад
thanks for the algorithm,since code part is way too easy and self implementable...
@aanchaljain4610
@aanchaljain4610 11 месяцев назад
Glad it helped!
@Rahul-kw6zf
@Rahul-kw6zf 3 месяца назад
Finally After 2 days got h pretty good solution!! Understood❤
@AdityaKumar-be7hx
@AdityaKumar-be7hx 8 месяцев назад
Great explanation! Only tip is we can reuse the "t" variable instead of creating a new shorter string. return t.substr(0, s.size()-i)+s;
@aanchaljain4610
@aanchaljain4610 8 месяцев назад
Thank you
@ArnabBhadra02
@ArnabBhadra02 День назад
Is it possible to solve Using longest common substring between s and rev(s) and after that return the total length -s
@VishalYadav-gk1kg
@VishalYadav-gk1kg 9 месяцев назад
Very Nice Explanation Mam, Thank you !
@silent-st1no
@silent-st1no 3 месяца назад
very very good explanation, thank you so much you are the great❤
@aanchaljain4610
@aanchaljain4610 2 месяца назад
Thanks ❤
@VivekSharma-sk3vp
@VivekSharma-sk3vp 39 минут назад
Memory Limit Exceeded!!😭😭
@srikarsaini
@srikarsaini 23 часа назад
10:06 Here we should not increment "j". There is a mistake in explanation. Check the code we are not incrementing "j" there in else statement. we are only changing the pointer "i".
@shh442
@shh442 Месяц назад
class Solution: def shortestPalindrome(self, s: str) -> str: if s == s[::-1]: return s n = len(s) # Loop to find the largest palindrome prefix for i in range(n, 0, -1): if s[:i] == s[:i][::-1]: break # Add the reverse of the suffix to the start of the string suffix = s[i:] return suffix[::-1] + s
@path8799
@path8799 2 месяца назад
Understood💯❤
@Yourcodehelper
@Yourcodehelper День назад
todays daily problem
@ss8273
@ss8273 Год назад
thanks sister explained very well🙌🙌
@aanchaljain4610
@aanchaljain4610 Год назад
Thank you
@PankajKumar-pk9dm
@PankajKumar-pk9dm 7 месяцев назад
loved the approach and awesome explanation
@priyanshupriyam174
@priyanshupriyam174 Месяц назад
Thanks a lot ma'am, cleared my kmp concepts well.
@machans-203
@machans-203 4 месяца назад
But it doesn't pass all test cases.. for string "aabba" the ans is "abbaabba" how is it possible And also, "abb" -> ans: "bbabb"
@harmankour1711
@harmankour1711 3 месяца назад
because given is we are allowed to add in the front only and it is passing all the test case just check your code again
@hhcdghjjgsdrt235
@hhcdghjjgsdrt235 5 месяцев назад
You got one subscriber
@naive-fleek7420
@naive-fleek7420 2 месяца назад
you are soo smart
@ujwalchawla6721
@ujwalchawla6721 6 месяцев назад
keep going🤘
@hackingkingdom5634
@hackingkingdom5634 10 месяцев назад
Nice approach Helpful✋
@aanchaljain4610
@aanchaljain4610 10 месяцев назад
Glad it was helpful!
@raviroy84
@raviroy84 8 месяцев назад
Clear explaination❤
Далее
LeetCode was HARD until I Learned these 15 Patterns
13:00
How to Install and Use an Adjustable TV Arm
00:18
Просмотров 1,1 млн
Shortest common superstring || InterviewBit
24:49
Просмотров 1 тыс.
My Brain after 569 Leetcode Problems
7:50
Просмотров 2,6 млн
How the C++ Linker Works
15:52
Просмотров 628 тыс.
Intro to Competitive Programming
11:41
Просмотров 776 тыс.
Longest palindromic substring | Dynamic programming
15:21
How to Install and Use an Adjustable TV Arm
00:18
Просмотров 1,1 млн