Розмір відео: 1280 X 720853 X 480640 X 360
Показувати елементи керування програвачем
Автоматичне відтворення
Автоповтор
Significance of adding $ ->--->$ helps us because lps function calculates longest proper prefix which means if complete string is a palindrome the lps.back() will always be one less than length of the string but adding a $ fixes that
Anyone wondering why $ has been added? Try doing the dry run for this test case with and without adding $s = "aaaa"
Deep Dive Explaination. Great Work!
finally understood lps O(n) algo...Thanks a lot
Amazing Explanation!
first must intuition be told not directly jumped to solution.
great!
Significance of adding $ ->--->$ helps us because lps function calculates longest proper prefix which means if complete string is a palindrome the lps.back() will always be one less than length of the string but adding a $ fixes that
Anyone wondering why $ has been added? Try doing the dry run for this test case with and without adding $
s = "aaaa"
Deep Dive Explaination. Great Work!
finally understood lps O(n) algo...Thanks a lot
Amazing Explanation!
first must intuition be told not directly jumped to solution.
great!