Challenge: Print Parenthesis Number

Let’s label opening and closing parentheses with numbers.

Problem

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

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.