Ad
  • Custom User Avatar
  • Custom User Avatar

    The kata has performance requirements, so it should specify input range.

  • Custom User Avatar

    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.

    I find these four solutions all summing to 3:

    1. sum(l[0:1]) => sum([3]) => 3
    2. sum(l[0:3]) => sum([3, -1, 1]) => 3
    3. sum(l[6:7]) => sum([3]) => 3
    4. 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?