Created
October 29, 2009 00:02
-
-
Save tessro/220996 to your computer and use it in GitHub Desktop.
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 characters
#!/usr/bin/env ruby | |
# http://www.facebook.com/careers/puzzles.php?puzzle_id=7 | |
# Memory-heavy but low-computation solution | |
LOOP = [nil, nil, "Hoppity", nil, "Hophop", "Hoppity", nil, nil, "Hoppity", "Hophop", nil, "Hoppity", nil, nil, "Hop"] | |
File.open(ARGV[0], 'r') do |f| | |
f.readline.to_i.times do |i| | |
puts LOOP[i] unless LOOP[i].nil? | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment