def
insertion_sort(a)
a.each_with_index
do
|el,i|
j = i -
1
while
j >=
0
break
if
a[j] <= el
a[j +
] = a[j]
j -=
end
] = el
return
a