Wavelio Interview Question

Not difficult