Nicolas George wrote: >> What if the question is "Find all the English words that have an E >> in the 5th position and a U in the 7th"? > > Yes, what? Who would ever ask such a question? What is the point of such > a question? > > The point of such a question is only to try and disprove my point, but > my point is about useful operations, and therefore artificial questions > like that will not dent it.
I agree with you, I get the point and it is correct. In the above example it is not clear first of all where do we look for those English words. Assume you have them in string, you again need the offset - start of word and then check the fifth and seventh position, so further iteration. I never bothered to look in stdc++ or libc how it is implemented - for example c++ string at() operation. Can someone enlight us pls?