The Clever Cat

How many slices of the list in this file sum up to at least 32?

Details and Assumptions:

  • A slice is a contiguous selection of elements from an array. For example [4,5,6] is a slice of [1,2,3,4,5,6,7,8,9] but [3,4,5,7] is not.
  • An example of an acceptable slice in the above question would be [-23,5,20,21,18]. This slice can be found near the end of the array.
  • As an explicit example, in the case for "sum up to at least 2": gives [1,-2,3,-4,5] There are 6 such slices: [[1, -2, 3], [1, -2, 3, -4, 5], [-2, 3, -4, 5], [3], [3, -4, 5], [5]]
×

Problem Loading...

Note Loading...

Set Loading...