Created
May 28, 2009 08:00
-
-
Save fredrik/119176 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
# what's the single state in america whose name does not | |
# have any letters in common with george w. bush? | |
states='Alabama | |
Alaska | |
Arizona | |
Arkansas | |
California | |
Colorado | |
Connecticut | |
Delaware | |
Florida | |
Georgia | |
Hawaii | |
Idaho | |
Illinois | |
Indiana | |
Iowa | |
Kansas | |
Kentucky | |
Louisiana | |
Maine | |
Maryland | |
Massachusetts | |
Michigan | |
Minnesota | |
Mississippi | |
Missouri | |
Montana | |
Nebraska | |
Nevada | |
New Hampshire | |
New Jersey | |
New Mexico | |
New York | |
North Carolina | |
North Dakota | |
Ohio | |
Oklahoma | |
Oregon | |
Pennsylvania | |
Rhode Island | |
South Carolina | |
South Dakota | |
Tennessee | |
Texas | |
Utah | |
Vermont | |
Virginia | |
Washington | |
West Virginia | |
Wisconsin | |
Wyoming'.split("\n") | |
name='georgewbush'.split('').uniq | |
def name_in_state(name, state) | |
return (state - name) == state | |
end | |
for state in states | |
if name_in_state(name, state.downcase.split('')) | |
puts "well, it's #{state}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment