Maximum billboard height
You are building a billboard supported by two steel rods of equal height, one on each side. You have a collection of rods of various lengths and may weld any subset together for each side, but the two sides must end up exactly equal in total length (some rods may go unused). Return the largest possible height of the billboard (the common length), or 0 if no nonempty equal split exists. There are at most 20 rods, each length 1..1000, with total length at most 5000.
Implement
tallest_billboard(rods: list[int]) → intExamples
in
[[1,2,3,6]]out6What a strong answer looks like
State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
0:00 of about 40 min
solution.py
InputExpectedGot
[[1,2,3,6]]6not run yetsample