Erase Pairs to Smallest Shortest String

Asked at Amazon · Coding Questions · Difficulty: Hard

In one move you erase any two identical letters of `s` (the remaining characters keep their relative order). Return the shortest string obtainable; among all shortest results, return the lexicographically smallest.

Loading the problem…