Pergunta de entrevista da empresa Connected

For the first problem, the input is unclear.