You are viewing a single comment's thread. Return to all comments →
Java 8 Solution using reduce
public static int simpleArraySum(List<Integer> ar) { // Write your code here return ar.stream().reduce(0, (n1,n2) -> n1 + n2); }
Seems like cookies are disabled on this browser, please enable them to open this website
Simple Array Sum
You are viewing a single comment's thread. Return to all comments →
Java 8 Solution using reduce