Coding exercises from http://codility.com/train/