You are installing a billboard and want it to have the largest possible height. The billboard will have two steel supports, one on each side, and each support must have the exact same height.
You are given an integer array rods representing the lengths of rods that can be welded together. You can choose two disjoint subsets of rods to build the two supports such that both subsets have the same total sum. You do not need to use all available rods, and rods cannot be broken into smaller pieces.
Return the maximum possible height of the billboard. If it is not possible to construct two supports of equal height, return
Constraints:
rods.length
rods[i]
sum(rods[i])
You are installing a billboard and want it to have the largest possible height. The billboard will have two steel supports, one on each side, and each support must have the exact same height.
You are given an integer array rods representing the lengths of rods that can be welded together. You can choose two disjoint subsets of rods to build the two supports such that both subsets have the same total sum. You do not need to use all available rods, and rods cannot be broken into smaller pieces.
Return the maximum possible height of the billboard. If it is not possible to construct two supports of equal height, return
Constraints:
rods.length
rods[i]
sum(rods[i])