Awesome, three completely different implementations.

Mine's:

a.inject []{|s,x|(i=s.find_index{|y|y>=x})?s[0...i]+[x]+s[i..-1]:s+[x]}

-- 
Posted via http://www.ruby-forum.com/.