Revolut interview question

Please solve this following problem