Problem 726 · Hard

Number of Atoms

Keep a stack of atom counts for each open parenthesis; a closing group multiplies into its parent.

Open the interactive visualisation