You are viewing a single comment's thread. Return to all comments →
Swift resolution
var characters = Array(s) if n == 1 { return s.filter({ $0 == "a" }).count } else if s == "a" { return n } else { var count = s.filter({ $0 == "a" }).count * Int(n / s.count) var remining = characters[0..<(n % s.count)].filter({ $0 == "a" }).count return count + remining }
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 →
Swift resolution