Paycor interview question

Make program to get duplicate words in array