Last active
November 29, 2020 12:44
-
-
Save hyuki/9ff4f2dfe926b31d25a2837e620fc5f4 to your computer and use it in GitHub Desktop.
ooffee.rb - cf. https://twitter.com/hyuki/status/1333024547906355201
This file contains 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 characters
DATA.each do |w| | |
h = Hash.new(0) | |
w.chomp.split(//).map { |c| h[c] += 1 } | |
if h.keys.select { |key| h[key] % 2 != 0 }.size == 0 | |
puts w | |
end | |
end | |
__END__ | |
put | |
here | |
your | |
word | |
list | |
and | |
you | |
will | |
find | |
ooffee | |
word | |
for | |
example | |
as | |
follows | |
agaragar | |
appeases | |
bilabial | |
deed | |
intestines | |
peep | |
poop | |
reappear | |
redder | |
sees | |
signings | |
teammate |
Author
hyuki
commented
Nov 29, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment