Smaller Sum
CodeChefOpen on judge ↗
An array $A = [A_1, A_2, \ldots, A_N]$ is said to be good when the following condition holds: - For every pair of subsets $X$ and $Y$ of indices in the range $[1, N]$, such that $|X| < |Y|$, it holds that the sum of elements in $X$ is **strictly smaller** than the sum of elements in $Y$. More formally, it should hold that $\sum_{i \in X}A_i < \sum_{i \in Y}A_i$. For example, $[2, 2, 3]$ is a g
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