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

Commitb343bb9

Browse files
add 2124
1 parent48017b9 commitb343bb9

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

‎README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ _If you like this project, please leave me a star._ ★
88

99
| # | Title | Solutions | Video | Difficulty | Tag
1010
|-----|----------------|---------------|--------|-------------|-------------
11+
|2124|[Check if All A's Appears Before All B's](https://leetcode.com/problems/check-if-all-as-appears-before-all-bs/)|[Java](../master/src/main/java/com/fishercoder/solutions/_2124.java)||Easy||
1112
|2120|[Execution of All Suffix Instructions Staying in a Grid](https://leetcode.com/problems/execution-of-all-suffix-instructions-staying-in-a-grid/)|[Java](../master/src/main/java/com/fishercoder/solutions/_2120.java)||Medium||
1213
|2119|[A Number After a Double Reversal](https://leetcode.com/problems/a-number-after-a-double-reversal/)|[Java](../master/src/main/java/com/fishercoder/solutions/_2119.java)||Easy||
1314
|2116|[Check if a Parentheses String Can Be Valid](https://leetcode.com/problems/check-if-a-parentheses-string-can-be-valid/)|[Java](../master/src/main/java/com/fishercoder/solutions/_2116.java)||Medium||
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
packagecom.fishercoder.solutions;
2+
3+
publicclass_2124 {
4+
publicstaticclassSolution1 {
5+
publicbooleancheckString(Strings) {
6+
intaIndex =s.lastIndexOf('a');
7+
if (aIndex <0) {
8+
returntrue;
9+
}
10+
for (inti =0;i <aIndex;i++) {
11+
if (s.charAt(i) =='b') {
12+
returnfalse;
13+
}
14+
}
15+
returntrue;
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp