We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
The Minion Game
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.