c# - Searching a multi dimensional array for a maximum -
i have following array:
a) 3,7,2 // length x width x height
b) 6,3,9
c) 5,9,3
i need perform search create new list, compiled of maximum value between length , width each variable. i.e. correct c# code problem return following list:
a) 7
b) 6
c) 9
any suggestions?
ienumerable<int> maxes = dimensions.select(dim => math.max(dim[0], dim[1])); or
ienumerable<int> maxes = dimensions.select(dim => dim.take(2).max());
Comments
Post a Comment