RELEX Solutions interview question

Solve a simple algorithm question, and explain your steps.