Pergunta de entrevista da empresa vAuto

nothing difficult, basic algorithm questions.