Radiant Logic interview question

Medium level difficult online test