Skip to content

Instantly share code, notes, and snippets.

@JeffersonCarvalh0
Created April 15, 2020 19:55
Show Gist options
  • Save JeffersonCarvalh0/91e3613c0883090c196780d1e96c1ee5 to your computer and use it in GitHub Desktop.
Save JeffersonCarvalh0/91e3613c0883090c196780d1e96c1ee5 to your computer and use it in GitHub Desktop.
b = []
n.times do
m = a[ 0 ]
mi = 0
a.each_with_index do |element, i|
if element < m
m = element
mi = i
end
end
a.delete_at( mi )
b << m
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment