Skip to content

Instantly share code, notes, and snippets.

@chriswk
Created March 18, 2015 11:50
Show Gist options
  • Save chriswk/c9e367511d21e693bdd4 to your computer and use it in GitHub Desktop.
Save chriswk/c9e367511d21e693bdd4 to your computer and use it in GitHub Desktop.
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