Domanda di colloquio di Even Financial

Solving a standard Leetcode medium/hard type question.