File tree 2 files changed +12
-30
lines changed
src/main/java/com/fishercoder/solutions
2 files changed +12
-30
lines changed Original file line number Diff line number Diff line change
1
+ package com .fishercoder .solutions ;
2
+
3
+ public class Contest {
4
+
5
+
6
+ public static void main (String ... args ) {
7
+ Contest contest = new Contest ();
8
+ System .out .println (contest );
9
+ System .out .println ("Finished." );
10
+ }
11
+ }
Original file line number Diff line number Diff line change 1
1
package com .fishercoder .solutions ;
2
2
3
- import java .util .Stack ;
4
-
5
- /**
6
- * 856. Score of Parentheses
7
- *
8
- * Given a balanced parentheses string S, compute the score of the string based on the following rule:
9
- * () has score 1
10
- * AB has score A + B, where A and B are balanced parentheses strings.
11
- * (A) has score 2 * A, where A is a balanced parentheses string.
12
- *
13
- * Example 1:
14
- * Input: "()"
15
- * Output: 1
16
- *
17
- * Example 2:
18
- * Input: "(())"
19
- * Output: 2
20
- *
21
- * Example 3:
22
- * Input: "()()"
23
- * Output: 2
24
- *
25
- * Example 4:
26
- * Input: "(()(()))"
27
- * Output: 6
28
- *
29
- * Note:
30
- * S is a balanced parentheses string, containing only ( and ).
31
- * 2 <= S.length <= 50
32
- * */
33
3
public class _856 {
34
4
public static class Solution1 {
5
+ //TODO: implement it
35
6
public int scoreOfParentheses (String S ) {
36
7
return -1 ;
37
8
}
You can’t perform that action at this time.
0 commit comments