Skip to content

Commit 19352fa

Browse files
refactor 678
1 parent 7f58f0e commit 19352fa

File tree

1 file changed

+0
-27
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-27
lines changed

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

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,6 @@
22

33
import java.util.Stack;
44

5-
/**
6-
* 678. Valid Parenthesis String
7-
*
8-
* Given a string containing only three types of characters: '(', ')' and '*',
9-
* write a function to check whether this string is valid. We define the validity of a string by these rules:
10-
11-
1. Any left parenthesis '(' must have a corresponding right parenthesis ')'.
12-
2. Any right parenthesis ')' must have a corresponding left parenthesis '('.
13-
3. Left parenthesis '(' must go before the corresponding right parenthesis ')'.
14-
4. '*' could be treated as a single right parenthesis ')' or a single left parenthesis '(' or an empty string.
15-
5. An empty string is also valid.
16-
17-
Example 1:
18-
Input: "()"
19-
Output: True
20-
21-
Example 2:
22-
Input: "(*)"
23-
Output: True
24-
25-
Example 3:
26-
Input: "(*))"
27-
Output: True
28-
29-
Note:
30-
The string size will be in the range [1, 100].
31-
*/
325
public class _678 {
336
public static class Solution1 {
347
/**

0 commit comments

Comments
 (0)