← All problemsSign in

Identical Arrays

You are given two arrays(A and B) each of size $N$. In one step you can choose any two index $l$ and $r$ such that $ 1 \leq l \leq r \leq N $ and increment $B[i]$ by 1 for $ l \leq i \leq r $. Find the minimum number of steps required to make both are identical. ###Input: - First line will contain $N$, size of each array. - Second line contains $N$ space separated integers, $ith$ number denot

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