sorting a multidimensional array in ruby -


i have following array:

[["2010-01-10", 2], ["2010-01-09", 5], ["2009-12-11", 3], ["2009-12-12", 12], ["2009-12-13", 0]]

i want sort second value in each group , return highest one, want output 12 given input above.

update

i might add made array using to_a, hash, if there away same hash better.

use on hash:

hash.values.max 

if need highest element, there no need sort it!


Comments

Popular posts from this blog

List<T>().Add problem C# -

Javascript natural sort array/object and maintain index association -