Revolut interview question

Home task for coding - I am not a developer