The solutions to Codility lessons