INCREASING ARRAY
CodeChefOpen on judge ↗
A set $b$ comprising of $k$ distinct integers ranging from $1$ to $n$ and an array having $n$ integers $a1$, $a2$ .... $an$, is given to you. Rule- In a single operation, you may choose two integers $i$ and $x$ (1 ≤ $i$ ≤ $n$, $x$ can be any integer) and assign $ai$ = $x$. This operation can be done only if i does not belong to the set $b$. Task- You have to calculate the minimum number of
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