You are given an array nums of n + 1 integers where every value lies in the range [1, n] . By the pigeonhole principle at least one value repeats; here exactly one number is repeated, though it may appear more than twice. Return that repeated number. Input format Input is a single array, e.g. [[1,3,4,2,2]] .