We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I'm having some trouble on multiple problems using F#.
I've written the following code for this problem:
let p = Console.ReadLine()
let q = Console.ReadLine()
let mix p q = Seq.map2 (fun p1 q1 -> (p1 |> string) + (q1 |> string)) p q
printfn "%s" (Seq.fold (fun e v -> e + v) "" (mix p q))
It does the right thing but is too slow for two testcases. Does anyone have any ideas on how to optimize this or have a good resource on the subject? It would be greatly appreciated!appreciated.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
String Mingling
You are viewing a single comment's thread. Return to all comments →
I'm having some trouble on multiple problems using F#.
I've written the following code for this problem:
It does the right thing but is too slow for two testcases. Does anyone have any ideas on how to optimize this or have a good resource on the subject? It would be greatly appreciated!appreciated.