标签:算法
  • equi-3 pair
    更新于:2018-06-29 09:48:13

    A non-empty zero-indexed array A consisting of N positive integers is given. A pair of indices (P, Q), such that 0 ≤ P ≤ Q < N, is called a slice of array A. The sum of a slice (P, Q) is the total of A[P] + A[P+1] + ... + A[Q].

    The equi-3 pair is a pair of indices (X, Y), such that 0 < X, X + 1 < Y < N − 1, and the sums of slices (0, X−1), (X+1, Y−1), (Y+1, N−1) are all equal.