LaunchpadStacks

L2: Ring Count

The docking rings on Orimovo's spindle are assembled from three kinds of clamp: (), [] and {}. Each line of your input is one ring group, written as a string of those six characters.

A group is balanced if every opening clamp is closed by the matching kind, in the right order, and nothing is left open. For example:

([]{})
(]
{[()()]}
((
[{}](

Only the first and third lines are balanced, so the answer is 2.

How many ring groups in your input are balanced?