Skip to content

Instantly share code, notes, and snippets.

@terjokhin
Created September 18, 2017 09:29
Show Gist options
  • Save terjokhin/fdcec57aa7b5a496ca746f5ae976abdd to your computer and use it in GitHub Desktop.
Save terjokhin/fdcec57aa7b5a496ca746f5ae976abdd to your computer and use it in GitHub Desktop.
val l1 = List(1,2,3,4,4,5)
val l2 = List(1,4,2,3,4,5)
val l3 = List(1,2,2,3,4,5)
def check[T](l1: List[T], l2: List[T]): Boolean = {
l1.groupBy(identity) == l2.groupBy(identity)
}
check(l1, l2)
check(l1, l3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment