Loading...
Loading...
Loading...
A warehouse has N crates, each with a weight. Can the crates be split into two shipments of exactly equal total weight? Every crate goes in exactly one shipment. Print YES or NO.
Example 1
Input
4 1 5 11 5
Output
YES
1 + 5 + 5 = 11, the other shipment is 11.
Example 2
Input
4 1 2 3 5
Output
NO
Try the problem first. Open one hint at a time.
An odd total can never be split into two equal whole numbers.
Otherwise ask whether some crates add up to half of the total.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor