Domanda di colloquio di Samsung Research America

Simple coding question on leetcode