Algorithm challenge for Hack Reactor