Pregunta de entrevista de Infosys

Not cleared coding round , only solved 1 question