You are viewing a single comment's thread. Return to all comments →
Idk if it is faster but I feel like it is more FP
object Solution { def main(args: Array[String]) { val lines = io.Source.stdin.getLines().drop(1) println(lines.map( x => x.scanLeft(x)( (t,_)=>t.tail + t.head).drop(1).mkString(" ")) .mkString("\n")) } }
Seems like cookies are disabled on this browser, please enable them to open this website
Rotate String
You are viewing a single comment's thread. Return to all comments →
Idk if it is faster but I feel like it is more FP