Created
April 15, 2020 19:55
-
-
Save JeffersonCarvalh0/91e3613c0883090c196780d1e96c1ee5 to your computer and use it in GitHub Desktop.
This file contains 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
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