Search⌘ K

Challenge: Print Parenthesis Number

Explore how to implement a stack-based solution to number matching parenthesis pairs in expressions. This lesson helps you practice stack operations and problem-solving skills in Go by converting an expression with letters and math symbols into a numbered parenthesis sequence.

Problem

Given an expression, number each parenthesis pair such that for each pair, the opening and closing parenthesis have the same number.

Input

A ...