Skip to content

@Lysander6 /StringTransposition.scala secret
Last active

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Challenge #137 [Easy] String Transposition (http://redd.it/1m1jam)
package dailyprogrammer
import scala.io.Source
object StringTransposition extends App {
val words = Source.fromFile("D:/file.txt").getLines.toList.tail
val longestWord = words.maxBy(_.size)
val wordsTransposed = words.map(_.padTo(longestWord.size, ' ').toList).transpose
println(wordsTransposed.map(_.mkString).mkString("\n"))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.