← All problemsSign in

Least Absolute Difference

Chef was given with an array of size N ,split or divide array N into two subarrays, say A and B such that the difference between the sum of elements in A and B is least among all the possible cases. The chef is supposed to tell the least absolute difference between those two subsets A and B. ### Input First line is the size of the array N. Next N lines consists of each integer in each line. ###

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