icps

notes

陣列中最長的元素

1
2
3
4
arr =[["I","block"],["love","wikipedia"],["apple","worst"]]

arr.collect{|i| i[1]}.max_by(&:length).length
arr.collect(&:first)