Pergunta de entrevista da empresa ION Group

Approach of two puzzles (riddles from GeeksforGeeks).