depth to keep track of the current depth level, starting at 0.result to store the group assignment for each parenthesis.seq.
depth.depth is even, or to group 1 if depth is odd.result list.depth after the assignment.result list containing the group assignments.