Syncoms interview question

Through codility