• Challenge Author
    + 4 comments

    Something like

    def f(p: List[Char], q: List[Char]) : List[Char] = {
        if (p.isEmpty) List()
        else (p.head :: q.head :: f1 (p.tail, q.tail))
    }
    

    PS: Almost all the challenges are designed such that you don't need mutable variables to solve them.