Lucid Software interview question

There was an algorithms question that they asked to implement.