- Видео 3
- Просмотров 8 842
Aanchal Jain
Добавлен 14 сен 2017
2808. Minimum Seconds to Equalize a Circular Array||Leetcode||Logic Explained
Error Correction: At 15:31, between 7&1 four different elements are present and the answer would be ceil(4/2), i.e. 2. The final answer is not affected.
Recommendation: Watch it at 1.75x or 2x
Like,share and subscribe
Recommendation: Watch it at 1.75x or 2x
Like,share and subscribe
Просмотров: 204
Видео
214.Shortest Palindrome || Leetcode || Solved&Explained || C++
Просмотров 9 тыс.Год назад
Solved a problem from leetcode. Problem Name:Shortest Palindrome Level:Hard Link to the problem: leetcode.com/problems/shortest-palindrome/description/ Recommended: Watch it on 1.75x or 2x.
Memory Limit Exceeded!!😭😭
Thank You !!!
thanks ma'am for making this concept so easy
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".
she just taught KMP, good explanation
you tried well Understanding a problem and effectively explaining it to others are two entirely different skills.
todays daily problem
Is it possible to solve Using longest common substring between s and rev(s) and after that return the total length -s
Thanks a lot Aanchal! Your explanation was super clear and easy. You should continue making more such videos and with consistency, you'll definitely grow your channel sure by making playlists or adding thumbnails to your videos. Really appreciate you efforts!
Best explanation so far
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
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!!!
Thanks a lot ma'am, cleared my kmp concepts well.
you are soo smart
Understood💯❤
Finally After 2 days got h pretty good solution!! Understood❤
very very good explanation, thank you so much you are the great❤
Thanks ❤
But it doesn't pass all test cases.. for string "aabba" the ans is "abbaabba" how is it possible And also, "abb" -> ans: "bbabb"
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
You got one subscriber
keep going🤘
loved the approach and awesome explanation
Kindly add problem link in description also. Also use some tags for good reach.
Clear explaination❤
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;
Thank you
Very Nice Explanation Mam, Thank you !
nice
Nice approach Helpful✋
Glad it was helpful!
thanks for the algorithm,since code part is way too easy and self implementable...
Glad it helped!
Error Correction: At 15:31, between 7&1 four different elements are present and the answer would be ceil(4/2), i.e. 2. The final answer is not affected.
thanks sister explained very well🙌🙌
Thank you
thanks for make it. your explanation is very well 😊😊 i hope you will continue ..& grow
sure!thank you
My search for it's solution finally came to an end . Thanks for such a great explanation .
Very well explained 👍