Argos interview question

A difficult algorithm question