Capco interview question

Not very deficult