Lexicographically Smallest Valid String

Company: Microsoft_23july

Difficulty: medium