Find Beautiful Indices in the Given Array | Part I & II | KMP Algorithm | String Matching Algorithm

preview_player
Показать описание
In this video, I'll talk about how to solve Leetcode 3008. Find Beautiful Indices in the Given Array II

Let's Connect:

About Me:
I am Aryan Mittal - A Software Engineer in Goldman Sachs, Speaker, Creator & Educator. During my free time, I create programming education content on this channel & also how to use that to grow :)

✨ Timelines✨
0:00 - Problem Explanation + Intuition
5:18 - KMP (Knuth Morris Pratt) Algorithm - Building Up
23:04 - Intuition of KMP working
30:00 - Dry Run of Entire Algo with Code
42:00 - Code Explanation
47:00 - Time Complexity Proof
53:00 - Continue Hard Problem Solving
58:00 - Code Explanation of Hard Problem

✨ Hashtags ✨
#programming #Interviews #leetcode #faang #maang #datastructures #algorithms
Рекомендации по теме
Комментарии
Автор

You're just crazy I would say. Just crystal clear understanding of the most complex algorithm of dsa. Your effort = 100/100, understandability=100/100. Grateful towards you =100/100

SupriyoGhosh-gzfs
Автор

don't know how the lecture ended in a blink.
amazing teaching ability

dhruvdangi
Автор

The part where you explained the Intuition of KMP working is just out of the world!!

lavanya_m
Автор

finally learned kmp .clean and clear explanation .
thank you so much bro.

k.satish
Автор

You're just crazy I would say. Just crystal clear understanding of the most complex algorithm of dsa. Your effort = 100/100, understandability=100/100. Grateful towards you =100/100
🙂🙃

asthajain
Автор

I have already watched Neetcode video of kmp, but your version of KMP is best.I liked your video bro, thank you.

jayendrareddy
Автор

Thank you for the video.
Understood everything about kmp.

ajaysubramaniam
Автор

The number of times you have sent Broo to ask for matching the pattern, now he is not anymore bro he is telling "jaa khud puchkar aa ".

abhinavkumar
Автор

I figured out why the balloon came, it was because you made a victory sign with your two fingers while explaining.😄

priyeshtandel
Автор

bhai ive watched at;east 10 15 videos on lps kmp but could'nt get the intuition for some time i could mug up..but forget after some time...this time i got the proper intuition thanks so much

kunalkumarshukla
Автор

"I wouldn't have said 'bro' this many times in my entire life as you did in this video alone 😂..But really nice explanation ❤"

kkkkkkkkkk
Автор

I want to find O(M) space of LPS array i.e. to use only of pattern length. Where to find it?

satishkumarpatra
Автор

35:42 iska intution ptaa hai kisiko aisa krne se answer kyu aara?

AnirudhSharma-xeje
Автор

btwn z-function and kmp wch one is good?

satwiktatikonda
Автор

Hi, at the example with s = "aabaacaabaaa" the last lps element should be 2 not 0. Am I wrong? In my opinion should be like lps = [0, 1, 0, 1, 2, 0, 1, 2, 3, 4, 5, 2] and not [0, 1, 0, 1, 2, 0, 1, 2, 3, 4, 5, 0]. Timestamp: 9:23

badrelmazaz
Автор

I am just not getting the intuition behind :
If current character doesnt matches the previousindex character then why should we go to its previous index and repeat same process?
Unable to understand intuition behind that while loop stuff!

codewithom
Автор


lps[i] = prev_idx + (s[i] == s[prev_idx] ? 1 : 0);


How are you soo sure that if the character at index "i" matches with character at "prev_idx" then we can get the lps of current index by adding "prev_idx" to it ?

I mean I agree that characters at index "i" & "prev_idx" match, but we don't have any idea about what character is at index "i-1" and whether it is in the longest suffix matching the prefix. Without this idea, how can we add "prev_idx" ?

rakeshvarma
Автор

Bhai please don't use "bhaiya" word, i think those who are watching your vedio are not your little brother can be your big brother. It feels bad please don't use it.

suyashsingh