Python : Longest Substring Without Repeated Characters

preview_player
Показать описание
Video 11:
This video shows how to find the longest substring without repeated characters. We have three different approach to address this question. The first approach is an brute force method which is not advised for interview purpose. Because the time complexity of the first approach is O(n^2). The second and third approach are having cost complexity as linear O(n) , where n is the length of the input string. Basically we track the length of the substring until it finds a repeated character. Once it finds the repeated character, it checks if the length of the previous subset is greater than or less than the length of the new subset.
The difference between the second and third approach is, the second approach gets only the length of the longest substring and the third approach tracks both the length as well as the actual string

Follow me on,

#list #substring #uniquesubset #uniquesubstring #longestsubstring #slicing #lineartimecomplexity #python #pythonquestions #pythontest #pythonprogramming #pythontutorial #python3 #pythonforbeginners #interviewquestions #interview #dataengineers #deinterview #pythoninterview #interviewquestions #leetcode #placementpreparation #meta #google #facebook #apple #netflix #amazon #google #faang #maanga #dataengineers #alphanumeric #nonalphanumeric #growwithdata
Рекомендации по теме