Cubist IT interview question

Given an array of numbers, write a function which returns the first duplicate of the array.