Hello, i don't understand 1 little thing:
if (words[i-1]!=words[i]) // is this a new word?
This code snippet must to compare 2 words in vector to see if they are the same,
but why it compares all the words, and not the only [i] and [i-1] ?
Is it vector type not the same for comparing as an array of strings?
Last edited on
whoops ! :)
i didn't noticed this line
sort(words.begin(), words.end()); // because of it i have this result?
If the vector is sorted then identical words will be adjacent.