Argos Interview Question

A difficult algorithm question