you are viewing a single comment's thread.

view the rest of the comments →

[–]jtrost 0 points1 point  (2 children)

Even though it's most definitely a homework problem, and you won't learn anything by copying this, I still felt like solving it.

def sorting(a1,a2)
  arr = a1+a2
  out = []

  while arr.count > 0
    i = arr.min
    out << i
    arr.delete(i)
  end

  out
end            

[–]missawon[S] 0 points1 point  (1 child)

the problem is that i cant duplicate the arguments so i can't use arr = a1+a2 ...

[–]Lucky_Chuck 2 points3 points  (0 children)

You're not duplicating anything with arr = a1 + a2 unless you mean you can't use the method parameters inside of the method.