Vanguard interview question

See String Compression on Leetcode