AK and 3N Sequences
CodeChefOpen on judge ↗
You are given a sequence of length $3N$ $P$. Your task is to construct a sequence $Q$ of length $2N$, by removing $N$ elements from $P$ and without changing the order of the elemnts in $P$. The value $D$ is given by :- $D$ = ( Sum of elements in the first half of the array ) - ( Sum of elements in the second half of the array ) You have to find the maximum possible value of $D$ in the
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