Multiply & Sum two ArrayLists in Java8
int sum =
IntStream.range(0, min(a.size(), b.size())
.map(i -> a.get(i) * b.get(i))
.sum();
int sum =
IntStream.range(0, min(a.size(), b.size())
.map(i -> a.get(i) * b.get(i))
.sum();