← All problemsSign in

Equal Beauty

The **beauty** of an (non-empty) array of integers is defined as the difference between its largest and smallest element. For example, the **beauty** of the array $[2,3,4,4,6]$ is $6 - 2 = 4$. An array $A$ is said to be **good** if it is possible to partition the elements of $A$ into two non-empty arrays $B_1$ and $ B_2$ such that - $B_1$ and $ B_2$ have the same beauty. - Each element of arr

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