LeetCode solutions

2243. Check if All A's Appears Before All B's

My accepted C++ solution to LeetCode problem 2243, Check if All A's Appears Before All B's, running in 0ms.

  • Difficulty: Easy
  • C++
  • Runtime 0ms
  • Memory 8.2MB

Read the problem on LeetCode View on GitHub

C++

Accepted on LeetCode — runtime 0ms, memory 8.2MB, accepted 2025-12-27.

cpp
class Solution {
    public:
        bool checkString(string s) {
                return s.find("ba") == string::npos;
                    }
                    };

Source