Play with subarray
CodeChefOpen on judge ↗
Vicky and Ricky are playing a game, in which they are given an array **A** of size **n**. Vicky's score can be determined by the following conditions: 1. Number of **subarrays** (which starts & ends with negative number) from i=0 to i=k (where k>=0 and k<=n-2) in array **A** whose sum of elements is zero. Ricky's score can be determined by the following conditions: 1. Number of **subarrays**
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start