Pregunta de entrevista de Venti Technologies

Average C++ question. Leetcode easy and medium level.