Algorithm · Bloomberg · Easy
Given a string made up exclusively of ( and ), find its nesting depth. This value is the largest number of opening parentheses that are nested at any point in the string. For example, (()()) has depth 2, whereas () has depth 1. Account for edge cases, including an empty input or a string with no valid parenthesis pair. Return the calculated depth from a function. Example The two opening parentheses appear inside one another before they are closed, so the greatest nesting…
Checking your access…