This kata is a duplicate of https://www.codewars.com/kata/60df63c6ce1e7b0023d4af5c
The kata has performance requirements, so it should specify input range.
I'm seeing a bug in the random tests, here's an example:
With these inputs: l = [3, -1, 1, -8, -6, 10, 3, 0, -7, 0], and s = 3.
l = [3, -1, 1, -8, -6, 10, 3, 0, -7, 0]
s = 3
I find these four solutions all summing to 3:
3
sum(l[0:1]) => sum([3]) => 3
sum(l[0:3]) => sum([3, -1, 1]) => 3
sum(l[6:7]) => sum([3]) => 3
sum(l[6:8]) => sum([3, 0]) => 3
The error message says I should be finding 3 not 4 solutions, are solutions that end in zero excluded from the count?
Loading collection data...
This kata is a duplicate of https://www.codewars.com/kata/60df63c6ce1e7b0023d4af5c
The kata has performance requirements, so it should specify input range.
I'm seeing a bug in the random tests, here's an example:
With these inputs:
l = [3, -1, 1, -8, -6, 10, 3, 0, -7, 0]
, ands = 3
.I find these four solutions all summing to
3
:sum(l[0:1]) => sum([3]) => 3
sum(l[0:3]) => sum([3, -1, 1]) => 3
sum(l[6:7]) => sum([3]) => 3
sum(l[6:8]) => sum([3, 0]) => 3
The error message says I should be finding 3 not 4 solutions, are solutions that end in zero excluded from the count?