Lexicographically Smallest Grid Path String

Company: Sprinklr_2oct

Difficulty: medium