Pregunta de entrevista de Kloudrac

Coding Problem Was Given to solve within 20 mins