@@ -0,0 +1,535 @@
+package leetcode;%0A%0Aimport java.util.Stack;%0A%0A/**%0A * https://leetcode.com/problems/maximum-nesting-depth-of-the-parentheses/%0A */%0Apublic class Problem1614 %7B%0A    public int maxDepth(String s) %7B%0A        int answer = 0;%0A        Stack%3CCharacter%3E stack = new Stack%3C%3E();%0A        for (char c : s.toCharArray()) %7B%0A            if (c == '(') %7B%0A                stack.add('(');%0A            %7D else if (c == ')') %7B%0A                stack.pop();%0A            %7D%0A            answer = Math.max(answer, stack.size());%0A        %7D%0A        return answer;%0A    %7D%0A%7D%0A

Solve problem 1614