Skip to content

Commit bf0695d

Browse files
refactor 856
1 parent aebb84b commit bf0695d

File tree

2 files changed

+12
-30
lines changed

2 files changed

+12
-30
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
}

src/main/java/com/fishercoder/solutions/_856.java

+1-30
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,8 @@
11
package com.fishercoder.solutions;
22

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-
* */
333
public class _856 {
344
public static class Solution1 {
5+
//TODO: implement it
356
public int scoreOfParentheses(String S) {
367
return -1;
378
}

0 commit comments

Comments
 (0)