codility solution for Fish