Tap here to switch tabs
Problem
Submissions

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

med
30 min
Try to solve the Check if All A's Appears Before All B's problem.

Statement

Given a string s consisting only of the characters 'a' and 'b', return true if every 'a' appears before every 'b' in the string. Otherwise, return false.

Constraints:

  • 1≤1 \leq s.length ≤100\leq 100

  • s[i] is either 'a' or 'b'

⋮
Tap here to switch tabs
Problem
Submissions

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

med
30 min
Try to solve the Check if All A's Appears Before All B's problem.

Statement

Given a string s consisting only of the characters 'a' and 'b', return true if every 'a' appears before every 'b' in the string. Otherwise, return false.

Constraints:

  • 1≤1 \leq s.length ≤100\leq 100

  • s[i] is either 'a' or 'b'