Pergunta de entrevista da empresa IBM

coding question similar to leetcode.