Pregunta de entrevista de EXL Service

Coding question based on basic DSA and puzzles