Since you are using Ruby, here is one Ruby way;


list = [6,4,5,8,12,34,5,6,778,9,777,3,45]
p list.min #> 3
p list.sort #> [3, 4, 5, 5, 6, 6, 8, 9, 12, 34, 45, 777, 778]

-- 
A Look into Japanese Ruby List in English
http://www.kakueki.com/ruby/list.html