Missing String

3.3

3 votes
Problem

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\)

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

The given string saurabh , does not contain c hence answer is c.

Editor Image

?