Hi Walt,
Well, Lerner posted this helpfull piece of pseudo code:
bool found = false
for each word in the array //this word
for each word prior to this word //current word
if this word is the same as current word
set found to true
if not found
print out this word
And I thought, oh, now I get it:
-First I have a loop for the whole array.
-Then, I have a loop for the word that is being checked whether it exists allready.
-Then, if that word is the same one of the allready added words in the first loop, put the bool variable to true, if not, at the end of looping threw the second loop. Output the word, since it hasn't been added yet.
The idea of the exercise now is to print every word only once, meaning:
one
two
one
four
five
would have to print:
one
two
four
five
Somehow, I'm just not seeing what it is that is wrong with the code Ive written with the help of the pseudo code from Lerner.