Pergunta de entrevista da empresa Samsung Research America

Simple coding question on leetcode