You are viewing a single comment's thread. Return to all 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) }
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 →
Here is a scala implementation