You are viewing a single comment's thread. Return to all comments →
static int birthday(List<Integer> s, int d, int m) { int count = 0; for(int i=0; i<= s.size() - m; i++) { if( s.subList(i, i+m).stream().mapToInt(n -> n).sum() == d) { count++; } } return count; }
Seems like cookies are disabled on this browser, please enable them to open this website
Subarray Division
You are viewing a single comment's thread. Return to all comments →