File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
main/java/com/fishercoder/solutions
test/java/com/fishercoder Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,12 @@ public boolean isValid(String S) {
26
26
27
27
for (char c : S .toCharArray ()) {
28
28
if (c == 'c' ) {
29
- if (stack .isEmpty () || stack .pop () != 'b' ) return false ;
30
- if (stack .isEmpty () || stack .pop () != 'a' ) return false ;
29
+ if (stack .isEmpty () || stack .pop () != 'b' ) {
30
+ return false ;
31
+ }
32
+ if (stack .isEmpty () || stack .pop () != 'a' ) {
33
+ return false ;
34
+ }
31
35
} else {
32
36
stack .push (c );
33
37
}
Original file line number Diff line number Diff line change @@ -11,7 +11,9 @@ public class _1003Test {
11
11
private static _1003 .Solution1 solution1 ;
12
12
13
13
@ BeforeClass
14
- public static void setup () {solution1 = new _1003 .Solution1 ();}
14
+ public static void setup () {
15
+ solution1 = new _1003 .Solution1 ();
16
+ }
15
17
16
18
@ Test
17
19
public void test1 () {
You can’t perform that action at this time.
0 commit comments