Рет қаралды 5,486
As part of the interview preparation series, today we will see the sliding window technique to solve the longest sub-string without repeating the character program in leet code. For example, the longest substrings without repeating characters for “ABDEFGABEF” are “BDEFGA” and “DEFGAB”, with length 6. For “BBBB” the longest substring is “B”, with length 1. The desired time complexity is O(n) where n is the length of the string.