Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3df1a82

Browse files
refactor 1221
1 parent6b958be commit3df1a82

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
packagecom.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
publicclass_1221 {
354
publicstaticclassSolution1 {
365
publicintbalancedStringSplit(Strings) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp