You are viewing a single comment's thread. Return to all comments →
Haskell:
module Main where solve :: String -> Int -> Int solve ss n = let l = length ss c = length $ filter (== 'a') ss (m, r) = n `divMod` l d = length $ filter (== 'a') $ take r ss in m * c + d main :: IO () main = do ss <- getLine :: IO String n <- readLn :: IO Int print $ solve ss n
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 →
Haskell: