You are viewing a single comment's thread. Return to all comments →
Here is my solution in Scala. I feel like it could be much better, Please respond with your code if its faster or cleaner.
object Solution { def main(args: Array[String]) { val inputs=io.Source.stdin.getLines.drop(1).toList for (i <- inputs) { var string1 = i println((1 to string1.length()).map(e => string1.takeRight(string1.length - e) + string1.take(e) ).mkString(" ")) } } }
Rotate String
You are viewing a single comment's thread. Return to all comments →
Here is my solution in Scala. I feel like it could be much better, Please respond with your code if its faster or cleaner.