Skip to content

Instantly share code, notes, and snippets.

@sdanko11
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save sdanko11/9792006 to your computer and use it in GitHub Desktop.

Select an option

Save sdanko11/9792006 to your computer and use it in GitHub Desktop.
Sorting Function
def find_highest_index(array)
second_array = array.clone
while array.count > 1
first_number = array.first
index = array.index(first_number)
if first_number > array[index + 1]
array.delete_at(index + 1)
else
array.delete_at(index)
end
end
second_array.index(array.first)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment