prod function

int prod(
  1. List<int> seq
)

Calculates the product of a sequence of integers.

Implementation

int prod(List<int> seq) {
  int result = 1;
  for (int num in seq) {
    result *= num;
  }
  return result;
}