Pregunta de entrevista de Turing

2 coding challenges , one from easy and another form medium