Revolut interview question

Solve our take-away challenge