You are viewing a single comment's thread. Return to all comments →
It's an interesting problem, but the uploader has explained it in very complicated terms. From the left-most 'a' in 'banana' we get the FIVE words a-an-ana-anan-anana, and that is what matters. Then we need not worry about how many times a phrase 'a' or 'an' gets repeated. If we keep a list of which substring has been repeated how many times, the code becomes a bit more complex.