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.
The first 'for' loop counts the number of 'a's in the original string. The second 'for' loop counts the number of 'a's in the string of length (n%l). I do not know why you count that and how you end up with your final equation 'count = count*(n/l)+ count1;'...
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Repeated String
You are viewing a single comment's thread. Return to all comments →
The first 'for' loop counts the number of 'a's in the original string. The second 'for' loop counts the number of 'a's in the string of length (n%l). I do not know why you count that and how you end up with your final equation 'count = count*(n/l)+ count1;'...