Leftmost Repeating Character in a String | Repeating Character - First Appearance Leftmost

In this video, we are going to look at a basic string problem: leftmost repeating character. We solved the problem using two methods: 1)naive 2)efficient(array storing method) Method 1 (Traversing from Left to Right) We traverse the string from left to right. We keep track of the leftmost index of every character. If a character repeats, we compare its leftmost index with current result and update the result if result is greater Method 2 (Traversing Right to Left) We traverse the string from right to left. We keep track of the visited characters. If a character repeats, we update the result. In this video, you’ll also learn about asymptotic notations, they are basically mathematical notations which represent order of growth of any mathematical function. There are three famous notati ... #ProgrammingKnowledge #Data_Structures_And_Algorithms #Data_Structures #algorithm #Algorithms #Algorithms_Tutorial #Data_Structures_Tutorial #Arrays #Strings #Stacks 20220715 bdIqEO8Qn6o
Back to Top