You are viewing a single comment's thread. Return to all comments →
My F# solution.
let SplitDigits (s: string) = s |> Seq.map(fun x -> (x |> int64) - (48 |> int64)) |> Seq.toList let main = let rec SumDigits digit : int64 = match digit with | head :: tail -> head + SumDigits tail | [] -> 0 |> int64 let rec GetSuper (number: int64 list) : int64 = let Super = SumDigits number if Super > (9 |> int64) then GetSuper (SplitDigits (Super |> string)) else Super let nk = Console.ReadLine().Split(" ") let digits = (((SplitDigits nk.[0] |> SumDigits) * (nk.[1] |> int64) ) |> string |> SplitDigits) GetSuper digits |> Console.WriteLine
Seems like cookies are disabled on this browser, please enable them to open this website
Super Digit
You are viewing a single comment's thread. Return to all comments →
My F# solution.