sum method

int sum()

Implementation

int sum() {
  if (isEmpty) return 0;

  return reduce((value, element) => value + element);
}