You are viewing a single comment's thread. Return to all comments →
mingle "" "" = ""
mingle p q = (head p) : (head q) : mingle (tail p) (tail q)
main = do
p <- getLine
q <- getLine
putStrLn $ mingle p q
did this pass? Without tail recursion, common-lisp fails at 9 and 10 (heap exhausted). And even with tail recursion, it fails at 10 because of the time limit, so I had to use a map, and no recursion, even though this is in the "recursion" section!!
Haskell solution did pass all the test cases. I don't know much about tail recursion to comment on that.