Attempt at Codility Fish problem