min method

int min()

Calculate the minimum value in the int list.

If there is no element, 0 is returned.

intのリストの中で最小値を算出します。

要素がない場合は0が返されます。

Implementation

int min() {
  if (isEmpty) {
    return 0;
  }
  return reduce((a, b) => a < b ? a : b);
}