ALEX interview question

Contain duplicate array, return index