Sorting is a good idea! I think for a data set of this size you probably won't lose or gain a lot by doing it one way over the other, but for llarger amounts of input data you probably should be thinking of alternatives to re examining all the elements in nArray.
I think the ideas are very different. My advice was:
Originally Posted by whiteflags
If you sort the words, any duplicates will be adjacent to each other. So finding unique word(s) is a matter of stepping through the list, comparing each word with every other word. You should end up with a list of unique words.
Because he said:
Originally Posted by Oonej
trying to find unique words but my logic is flawed again, any tips?
Now I took that to mean that out of a list like, ("cat", "planet", "factory", "factory", "factory") the list of unique words should be ("cat", "planet"). But you could certainly make a different list of unique words by removing repeated words, and that might be what is meant. But if you compare every word with every other word, you can find the list I just gave. It's simple logic -- if the first occurrence of the word is the only occurrence, then it is unique. (Sorting is intended to be a bit of a speedup, but I have to admit that it could end up being more trouble than it is worth.)