Pergunta de entrevista da empresa Argos

A difficult algorithm question