sameEnds: same group at both ends?
Return true if the group of len numbers at the start and at the end of the array are the same. For example, with {5, 6, 45, 99, 13, 5, 6}, the ends are the same for len = 0 and len = 2, but not for len = 1 or len = 3. Step through sameEnds: nums.length - len is where the end group starts, so box i of the front group lines up with box nums.length - len + i.