Skip to content

Commit 3df1a82

Browse files
refactor 1221
1 parent 6b958be commit 3df1a82

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

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

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,5 @@
11
package com.fishercoder.solutions;
22

3-
/**
4-
* 1221. Split a String in Balanced Strings
5-
*
6-
* Balanced strings are those who have equal quantity of 'L' and 'R' characters.
7-
* Given a balanced string s split it in the maximum amount of balanced strings.
8-
* Return the maximum amount of splitted balanced strings.
9-
*
10-
* Example 1:
11-
* Input: s = "RLRRLLRLRL"
12-
* Output: 4
13-
* Explanation: s can be split into "RL", "RRLL", "RL", "RL", each substring contains same number of 'L' and 'R'.
14-
*
15-
* Example 2:
16-
* Input: s = "RLLLLRRRLR"
17-
* Output: 3
18-
* Explanation: s can be split into "RL", "LLLRRR", "LR", each substring contains same number of 'L' and 'R'.
19-
*
20-
* Example 3:
21-
* Input: s = "LLLLRRRR"
22-
* Output: 1
23-
* Explanation: s can be split into "LLLLRRRR".
24-
*
25-
* Example 4:
26-
* Input: s = "RLRRRLLRLL"
27-
* Output: 2
28-
* Explanation: s can be split into "RL", "RRRLLRLL", since each substring contains an equal number of 'L' and 'R'
29-
*
30-
* Constraints:
31-
* 1 <= s.length <= 1000
32-
* s[i] = 'L' or 'R'
33-
* */
343
public class _1221 {
354
public static class Solution1 {
365
public int balancedStringSplit(String s) {

0 commit comments

Comments
 (0)