Revolut interview question

Problem solving