← All problemsSign in

Delete the Array

CodeChefRating 3613Open on judge ↗

You can perform the following operation on an array $A$: - Choose $1 \le i \lt |A|$ such that $A_i \ne A_{i + 1}$, and delete both $A_i$ and $A_{i + 1}$ from the array (renumbering the elements after $i + 1$). Define $f(A)$ as $f(A) = 1$ if the array $A$ can be changed into an empty array by deleting all elements using the above operation any number of times, otherwise $f(A) = 0$. Define $g(A)

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start