Goldman Sachs interview question

FInd the repeated elements in an array(java) Rain water problem