Data Structures & AlgorithmsModerateTCS NQT · Codeforces Div2 B

A split point is an index i (1 ≤ i ≤ n−1) that divides [1, 2, 3, 3, 2, 1, 4, 2] into a left part a[0..i−1] and a right part a[i..n−1] with equal sums. How many such split points exist?

  1. A. 1
  2. B. 0
  3. C. 2
  4. D. 3

Correct answer: A. 1

Compare the prefix sum with (total − prefix sum) at every split. Counting indices that skip one element on the right (the position itself removed) gives a different condition.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic