Try this: n = [4, 6, 7, 2, 15] def min(n) minimum = n[0] n.each do |element| if element < minimum minimum = element end end return minimum end
puts min(n) -- You received this message because you are subscribed to the Google Groups ruby-talk-google group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at https://groups.google.com/d/forum/ruby-talk-google?hl=en
