Advertisement
Guest User

ruby lambda with multiple condition

a guest
Mar 4th, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.08 KB | None | 0 0
  1. a = (1..10).map{|x| x = rand(2000)+10}
  2. a.sort_by{|x| [x.to_s[1], x.to_s.length, x]}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement