data-structures · beginner · ~15 min
Track a stack depth's high-water mark.
Implement int max_depth(const char *s) returning the deepest level of nested round parentheses. Assume the parentheses are balanced.
int max_depth(const char *s) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.