StyleSeat interview question

Leetcode style question, more tricky than technical