Created
July 8, 2013 21:11
-
-
Save cmar/5952531 to your computer and use it in GitHub Desktop.
Ruby LoCo Hack Night Challenge #1
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 | |
# | |
# Ruby LoCo Hack Night Challenge #1 | |
require 'benchmark' | |
a = [1, 2, 3, 4, 5] | |
b = [2, 5, 1, 3, 4] | |
# write a program to match indexes from a to b | |
time = Benchmark.measure do |x| | |
#do stuff here | |
# | |
expected = { 0 => 2, 1 => 0, 2 => 3, 3 => 4, 4 => 1 } | |
puts expected | |
end | |
puts '*' * 60 | |
puts time |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Got my solution to work:
took 0.003785 on my mac air