Check the last element to all the others and then recurse.