Skip to content

Instantly share code, notes, and snippets.

object DisjointGraphs extends App {
val disjoints = findThem(List((1,2), (2,3), (5,6), (7,8), (1,8)))
println(disjoints)
def findThem(edges: List[(Int, Int)]) = {
edges.foldLeft(List[Set[Int]]())({ (sets:List[Set[Int]], nextEdge: (Int, Int)) =>
// break up the list into 2 lists,
@kelvl
kelvl / README.md
Last active December 10, 2015 18:58 — forked from TMcManus/README.md

The python port of libphonenumber is pretty complete, but is a little short on examples and sample code. Here are some simple examples for some common uses of this fantastic library.

Note: Because libphonenumber uses static number range data, it is not the definitive refernce for number validity. However it serves as a great starting point to identify invalid numbers and format numbers into E.164 format.