Domanda di colloquio di iCapital

Asked a standard leetcode question