Trains the technique from
LeetCode 101Symmetric TreeThis is an original problem, written from a brief that listed the technique, the difficulty, the topics, the function shape and the input bounds — none of that problem's wording, examples, hints or editorials. The link is there so you can map your practice onto the standard set.
Same function shape, different story and different numbers.
A workshop assembles wind chimes. Everything hangs from one top hook, and each hook or arm may carry up to two arms below it, one on its left side and one on its right side. Every arm has a weight stamped on it.
Because the harness passes plain JSON, the chime arrives as the array joints, listed row by row from the top hook downwards. The first entry is the top hook's weight. After that, entries come in pairs: the next two entries give the left-side arm and the right-side arm of the next piece in that same row order. A side with nothing hanging on it is written null, and a null contributes no pair of its own.
A chime is called true when it is its own reflection: swap left for right everywhere below the top hook and you get the identical assembly, with matching weights and matching empty sides.
Return true if the chime is true, and false if it is not.
Example 1
The two arms under the hook both weigh 7, and their pairs 2 then 9 on one side face 9 then 2 on the other, so every piece meets its reflection.
Example 2
The left arm carries a 7 on its own left side while the right arm carries nothing at all, so the reflection breaks one row below the hook.
Example 3
The 5 hangs on the outer side of each 2, which is exactly where a reflection puts it.
The editor is preloaded with this. It matches the parent problem's shape, so a solution that works here transfers to a judge unchanged.
def chime_hangs_true(joints: list) -> bool:public boolean chimeHangsTrue(Integer[] joints)See the step-by-step animation, the intuition, and clean code in every language — free, no credit card.