But you see, all the other answers are equally valid.
"Find the number of times the *WORD* aaa appears in aaaaaaaaaaaa."
In ordinary text, a word is separated from other words by space or punctionation. So the answer is 0.
"Find the number of times inflections of the WORD aaa appear in aaaaaaaaaaaa."
We could consider that an inflection is any string that starts as specified and has any suffix. So the first aaa is the word and all else is part of the inflection. So the answer 1.
"Find the number of times the characters aaa appear in aaaaaaaaaaaa including overlaps." Clearly, there are 10 locations that start the text aaa, so the answer is 10.
And then your answer, and my original answer, to "Find the number of times the characters aaa appear in aaaaaaaaaaaa NOT including overlaps." I think this is the natural computer-ish way to do this, and the answer is of course 4. But I wonder if that's the right answer for any real-world application, where TEXT--and not just string s of characters--is involved.
Again, I'd vote for either 0 or 1, but of course we shouldn't and can't vote. KHB3283's instructor has the only vote that matters.
|