Domanda di colloquio di Amazon

SWE leetcode question around easy-medium difficultly.