Stingy Arrays
An array $B$ is said to be *stingy* if no two of its adjacent elements are equal. That is, $B$ is *stingy* iff $B_i \neq B_{i+1}$ for each $1 \leq i \lt |B|$. Alice and Bob have an array $A$ with them, and decided to play a game on it. They alternate turns, with Alice going first. On their turn, a player chooses any [subsequence](https://en.wikipedia.org/wiki/Subsequence) $S$ of $A$, such th
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