Skip to content

Instantly share code, notes, and snippets.

@epidemian
Created March 31, 2014 04:05
Show Gist options
  • Select an option

  • Save epidemian/9885047 to your computer and use it in GitHub Desktop.

Select an option

Save epidemian/9885047 to your computer and use it in GitHub Desktop.
a=$<.map{|l|l.split.sort}
p a.count{|s|1==a.count(s)}-1
5
7 6 5
5 7 6
8 2 9
2 3 4
2 4 3
2 3 3
@epidemian

Copy link
Copy Markdown
Author

Sample run:

$ ruby count-unique-triangles.rb <sample
2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment