You are viewing a single comment's thread. Return to all comments →
i am using the same idea but the problem i get some cases Wrong here is my Code with C#
static long repeatedString(string s, long n) {
double r = 0; foreach(char c in s) if (c== 'a') r++; double count = Math.Floor(n * r/s.Length); for(int i = 0; i< n%s.Length;i++) if(s[i]== 'a') count++; return Convert.ToInt64(count); }
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 →
i am using the same idea but the problem i get some cases Wrong here is my Code with C#
static long repeatedString(string s, long n) {