Skip to content

Instantly share code, notes, and snippets.

@magmel48
Created October 11, 2014 15:05
Show Gist options
  • Save magmel48/6b02e028626e7b8ed5be to your computer and use it in GitHub Desktop.
Save magmel48/6b02e028626e7b8ed5be to your computer and use it in GitHub Desktop.
rubyschool-1
heights = [180, 190, 160, 200]
names = [:Losikhin, :Knyazev, :Komlev, :Khodyrev]
hIndex = heights.index(heights.max)
puts names[hIndex]
def len (v1, v2)
unless v1 == v2
v1.length.times { |i| return i if v1[i] != v2[i] }
else
v1.length
end
end
first = "test-first"
second = "te-second"
len (first, second)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment