Skip to content

Instantly share code, notes, and snippets.

@PavelPenkov
Created October 23, 2013 15:26
Show Gist options
  • Save PavelPenkov/7120826 to your computer and use it in GitHub Desktop.
Save PavelPenkov/7120826 to your computer and use it in GitHub Desktop.
val dg = lines.foldLeft(Digraph(n)) {(g, line) => line.split(" ").map(_.toInt) match {
case Array(h, t) => g.addEdge(h, t)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment