I’d like to follow up on Coding Games and Programming Challenges to Code Better
First I had no idea how to solve this puzzle and felt I was missing a key piece of information. Only after reading the other forum comments regarding this puzzle did I learn that the n of a carbon unit and the number of adjacent bonds must equal 4.
Maybe I could have deduced this from the available information (as quotes below) but it would have been a great help for me if this just was just available as a note that n of a carbon unit and the number of adjacent bonds must equal 4.
The inputs given will have a valid representation, but the bonds might not be matching. For example, a carbon unit with n=1 should have 3 adjacent bonds, one with n=2 should have 2 adjacent bonds, etc.
In carbon units, 0≤n≤4
In bonds, 0<m≤4