Pergunta de entrevista da empresa Turing

2 coding challenges , one from easy and another form medium