8000 * Done with "2124. Check if All A's Appears Before All B's". · garciparedes/leetcode@34d44d7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 34d44d7

Browse files
committed
* Done with "2124. Check if All A's Appears Before All B's".
1 parent c6da1bc commit 34d44d7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution:
2+
def checkString(self, s: str) -> bool:
3+
a_mode = True
4+
for c in s:
5+
if c == "a" and not a_mode:
6+
return False
7+
elif c == "b" and a_mode:
8+
a_mode = False
9+
return True
10+

0 commit comments

Comments
 (0)
0