ING Interview Question

Codility easy to medium