Sort by

recency

|

54 Discussions

|

  • + 1 comment

    String mingling is like crafting a luxurious hairstyle—each element is intricately woven together, creating a harmonious and elegant final piece. The precision and creativity involved mirror the meticulous process of styling luxurious hair.

  • + 0 comments

    Haskell solution

    main = do
        a <- getLine  
        b <- getLine 
        
        putStrLn . concat $ map (\(x, y) -> [x, y]) $ zip a b
    
  • + 0 comments

    Do not call p.length every recursion!!! :)

    With use of List everything is fine in Scala solution.

  • + 0 comments
    main = interact $ (\(x:y) -> concat [ [a,b] | (a,b) <- zip x (head y) ]) . words
    
  • + 0 comments

    Here is a scala implementation

     def mingleStrings(s1:String,s2:String) :String =  {
            val n = s1.length()
            val sb = new StringBuilder("")
            def build(i:Int,accumulator:sb.type) :String = {
                if(i==n){
                    return accumulator.toString
                }
                accumulator+=s1.charAt(i)
                accumulator+=s2.charAt(i)
                return build(i+1,accumulator)
            }
            return build(0,sb) 
        }