StyleSeat Interview Question

Leetcode style question, more tricky than technical