Number of duplicate words can be found by using list.size()-duplicateWordList.size() : just passing by