Easy
Check if All A's Appears Before All B's — Python
Full explanation · Time O(n) · Space O(1)
# Time: O(n)
# Space: O(1)
class Solution(object):
def checkString(self, s):
"""
:type s: str
:rtype: bool
"""
return "ba" not in s