getMax method

int getMax(
  1. List<int> array
)

Return the maximum number in the array.

Implementation

int getMax(List<int> array) {
  var max = array.reduce((value, element) => value > element ? value : element);
  return max;
}