You are viewing a single comment's thread. Return to all comments →
private static int birthday(int n, int[] s, int d, int m) { if (n < m) return 0; return (int) IntStream.rangeClosed(0, n - m) .filter(i -> Arrays.stream(s, i, i + m).sum() == d) .count(); }
Seems like cookies are disabled on this browser, please enable them to open this website
Subarray Division 2
You are viewing a single comment's thread. Return to all comments →