Skip to content

Commit 57777cb

Browse files
authored
Create check-if-all-as-appears-before-all-bs.cpp
1 parent a55228a commit 57777cb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Time: O(n)
2+
// Space: O(1)
3+
4+
class Solution {
5+
public:
6+
bool checkString(string s) {
7+
return s.find("ba") == string::npos;
8+
}
9+
};

0 commit comments

Comments
 (0)