Pregunta de entrevista de Photon

it was hackerrank assessment round