Code Room
CodingHardcod-g932
Subject KnapsackLevel Senior–Staff~40 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

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]) → int
Examples
in[[1,2,3,6]]out6
What 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.

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.