has22: a 2 next to a 2?

Given an array of ints, return true if the array contains a 2 next to a 2 somewhere. Step through has22: each pass looks at a pair of neighbours, nums[i] and nums[i+1]. The loop stops one box early so that i+1 is never past the end.