• + 0 comments
    IntStream.range(0, (s.size() - m +1))
            .forEach(
                pos-> {
                    int sum = 
                    IntStream.range(pos, (pos+m))
                        .map(e->s.get(e))
                        .sum();
                    if(sum == d) {
                        possibleCombin.set(0, possibleCombin.get(0)+1);
                    } 
                }
            );