Permuted Greater than 2
You have an array $A$ consisting of $X$ $0$'s, $Y$ $1$'s and $Z$ $2$'s. Check if it is possible to rearrange array $A$ such that $A_i + A_{i + 1} \ge 2$ for each $1 \le i < |A|$. Print $\text{Yes}$ or $\text{No}$ accordingly. ### Input - The first line of input will contain a single integer $T$, denoting the number of test cases. - The first and only line of input contains $3$ integers $X$, $Y$
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