Solve 2 codility problems