Created
March 18, 2015 11:50
-
-
Save chriswk/c9e367511d21e693bdd4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Solution { | |
def main(args: Array[String]) { | |
val testCases = readInt | |
for(i <- 1 to testCases) { | |
val string = readLine | |
println(string.grouped(2) | |
.map(l => List(l(1), l(0))) | |
.flatten | |
.mkString("")) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment