Lexicographical String Game

Company: Amazon_3oct

Difficulty: medium