Skip to content

Instantly share code, notes, and snippets.

@Nakilon
Created September 9, 2014 01:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nakilon/7ab2120e67ed4ca036ca to your computer and use it in GitHub Desktop.
Save Nakilon/7ab2120e67ed4ca036ca to your computer and use it in GitHub Desktop.
a=*$<.map{|s|s.scan /[a-z]+/i}
a[0]+=x=[i=0]
a.map{n=*x
a.map{|b|(b&x)[0]&&n+=b}
exit p i if(["Erdos"]&x=n)[0]
i+=1}
puts"Inf"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment