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.
Repeated String
Repeated String
Sort by
recency
|
3738 Discussions
|
Please Login in order to post a comment
Rust solution:
Python3 Solution
One line Python solution:
def repeatedString(s, n): return s.count('a') * (n // len(s)) + s[:n % len(s)].count('a')
Here is Repeated string solution in python, java, c++, c and javascript programming - https://programmingoneonone.com/hackerrank-repeated-string-problem-solution.html