Revolut Interview Question

Problem solving