Given a string str, the task is to find the lexicographically smallest string that can be formed by removing at most one character from the given string.
Example 1
Inputabczd
Outputabcd
Example 2:
Inputabcda
Outputabca
Explanation
One can remove d to get abca, which is the lexicographically smallest string possible.