Solutions for codility challenges.