Solution

ID: past-exam-of-the-year-1-of-the-computer-science-course-of-the-university-of-oxford/2014/imperative-programming/1/b/i/solution

Take an integer pivot . There are possible values in but only occurrences of such values in the whole array. When , the pigeonhole principle gives
Repeated values do not invalidate the argument: they can only reduce the number of distinct values represented by those occurrences. The other side might also contain a missing value.

New to topics? Read the docs here!