Optimize problem 14 by just looking at length as opposed to sequences themselves