1021. Remove Outermost Parentheses
class Solution {
public String removeOuterParentheses(String s) {
StringBuilder result = new StringBuilder();
int depth = 0;
for (char c : s.toCharArray()) {
if (c == '(') {
if (depth > 0) {
...
searchinsert.hashnode.dev1 min read