RBC Interview Question

Not very difficult