Quote:
In an array of words some words are repeated twice(exactly twice), count such words.
You have basically 2 options:
1) Sort the list of word (any repeat will be next to the first occurence of a word), then scan the sorted list and count the repeats.
2) scan the unsorted list and build a dictionary. it a word is new, add it to dictionary, if word is already in dictionary, add 1 to number of time it is seen.