Created
July 8, 2018 23:33
-
-
Save bogardpd/58df3d9e1f749d42523c4ee30ee73fe1 to your computer and use it in GitHub Desktop.
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
state_codes = %w(AL AK AZ AR CA CO CT DE FL GA HI ID IL IN IA KS KY LA ME MD MA MI MN MS MO MT NE NV NH NJ NM NY NC ND OH OK OR PA RI SC SD TN TX UT VT VA WA WV WI WY) | |
state_codes.sort! | |
one_letter_changes = Hash.new() | |
state_codes.each do |sc| | |
one_letter_changes[sc] = state_codes.select{|s| sc != s && (sc[0] == s[0] || sc[1] == s[1])} | |
puts "#{sc}: #{one_letter_changes[sc].join(", ")}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment