Skip to content

Commit 650c9ea

Browse files
committed
Added 1579A - Casimir's String Solitaire.cpp
1 parent 3e7fd3c commit 650c9ea

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// ॐ नमः शिवाय
2+
#include<bits/stdc++.h>
3+
using namespace std;
4+
#define ll long long
5+
6+
// Code Written By: Vikash Patel
7+
// Codeforces Profile: https://codeforces.com/profile/vikashpatel
8+
9+
int main()
10+
{
11+
int t;
12+
cin>>t;
13+
while(t--)
14+
{
15+
string s;
16+
cin>>s;
17+
int a = 0, b = 0, c = 0;
18+
for(auto i : s)
19+
{
20+
if(i == 'A')
21+
a++;
22+
else if( i == 'B')
23+
b++;
24+
else
25+
c++;
26+
}
27+
if(a+c == b)
28+
cout<<"YES"<<endl;
29+
else
30+
cout<<"NO"<<endl;
31+
}
32+
return 0;
33+
}

0 commit comments

Comments
 (0)