Syncoms Interview Question

Through codility