Showing posts with label longest substring. Show all posts
Showing posts with label longest substring. Show all posts

Length of the longest substring without repeating characters

Length of the longest substring without repeating characters



Method 1 (Brute Force Method)
We can consider all substrings.
One by one and check for each substring whether it contains all unique characters or not. 

There will be n*(n+1)/2 substrings.