A simple solution to the codility problem