Smallest substring
Practice
3.9 (14 votes)
Algorithms
Binary search
Medium
Searching
Problem
78% Success 3915 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code
You are given a string \(S\) that is made of lowercase English alphabets. Determine the length of the smallest substring that contains the maximum number of distinct characters.
Input format
The only line of input consists of a string that is made of lower case English alphabets.
Output format
Print the required answer.
Constraints
\(1 \le |S| \le 10^5\) where \(|S|\) denotes the length of the string \(S\)
Submissions
Please login to view your submissions
Similar Problems
Points:30
4 votes
Tags:
AlgorithmsBinary Search
Points:30
4 votes
Tags:
Binary SearchMedium
Points:30
8 votes
Tags:
AlgorithmsBinary SearchHiringImplementationMediumSearchingString Manipulation
Editorial