Question d’entretien chez Goldman Sachs

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