Pregunta de entrevista de Nisum

Coding question similar to ones on leetcode