Tap here to switch tabs
Problem
Submissions

Problem: Tallest Billboard

med
30 min
Try to solve the Tallest Billboard problem.

Statement

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 00.

Constraints:

  • 1≤1 \leq rods.length ≤20\leq 20

  • 1≤1 \leq rods[i] ≤1000\leq 1000

  • sum(rods[i]) ≤5000\leq 5000

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Tallest Billboard

med
30 min
Try to solve the Tallest Billboard problem.

Statement

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 00.

Constraints:

  • 1≤1 \leq rods.length ≤20\leq 20

  • 1≤1 \leq rods[i] ≤1000\leq 1000

  • sum(rods[i]) ≤5000\leq 5000