Created
October 29, 2016 06:44
-
-
Save guilherme/96d1e41a1fcada6f006435672686e1b9 to your computer and use it in GitHub Desktop.
Revisions
-
guilherme created this gist
Oct 29, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ require 'cityhash' keywords = (0..4).to_a.inject(('a'..'z').to_a) do |perms, t| perms = ('a'..'z').to_a.product(perms) end.collect(&:join) mod2_zero = 0 mod2_one = 0 keywords.each { |k| (CityHash.hash32(k) % 2) == 0 ? (mod2_zero += 1) : (mod2_one += 1) } puts mod2_zero puts mod2_one