You are viewing a single comment's thread. Return to all comments →
Fast and very short solution for C# using LINQ:
private static long RepeatedString(string s, long n, char l = 'a') { return s.Count(c=> c==l)*(n/s.Length) + s.Take((int)(n%s.Length)).Count(c=> c==l); }
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 →
Fast and very short solution for C# using LINQ: