Missing String
Practice
3.3 (3 votes)
Algorithms
Medium
String manipulation
Problem
32% Success 909 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code

Given a string consisting of lowercase letters only, find the typographically smallest string not present as a substring in it.

Given two string S1 and S2. S1 is considered typographically smaller than S2 if either:

\(\bullet |S_1| < |S_2| \\ \bullet |S_1| = |S_2| \text{ and } S_1 \text{is lexicographically smaller than } S_2\)

Input:

The first line of input contains the string S.

Output:

Answer as stated above.

Constraints:

\(1 \le |S| \le 10^5\)

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
9 votes
Tags:
String AlgorithmsAlgorithmsC++String Searching
Points:30
8 votes
Tags:
String AlgorithmsAlgorithmsString Searching
Points:30
127 votes
Tags:
AlgorithmsApprovedKMP AlgorithmMediumOpenString Manipulation