#include <iostream>
using namespace std;
class Solution {
public:
bool isValid(const string& s) {
if(s.size() % 3) return false;
if(s.size() == 0) return true;
for(int i = 2; i < s.size(); i ++)
if(s[i - 2] == 'a' && s[i - 1] == 'b' && s[i] == 'c')
return isValid(s.substr(0, i - 2) + s.substr(i + 1));
return false;
}
};
int main() {
return 0;
}
#include <iostream>
using namespace std;
class Solution {
public:
bool isValid(string s) {
for(int i = s.find("abc"); i != string::npos; i = s.find("abc"))
s.erase(i, 3);
return s == "";
}
};
int main() {
return 0;
}