Maximum Nesting Depth of Two Valid Parentheses Strings LeetCode solution in Java

1
class Solution {
2
public int[] maxDepthAfterSplit(String seq) {
3
int[] res = new int[seq.length()];
4
for (int i = 0; i < seq.length(); i++) {
5
res[i] = seq.charAt(i) == '(' ? i & 1 : 1 - i & 1;
6
}
7
return res;
8
}
9
}

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0