Check if All A's Appears Before All B's Problem

Check if All A's Appears Before All B's Problem — ExecCode Easy DSA Practice

Solve the Check if All A's Appears Before All B's problem on ExecCode. Free online easy DSA practice in String. Write and run code in Java, C++, Python — no signup required to run.

Description Given a string s consisting of only the characters 'a' and 'b', return true if every 'a' appears before every 'b' in the string. Otherwise, return false. Examples Example 1 Input: s = "aaabbb" Output: true Explanation: The 'a's are at indices 0, 1, and 2, while the '…

Practice Check if All A's Appears Before All B's free on ExecCode. Browse more ExecCode DSA problems.