#include using namespace std; int main() { int t; cin >> t; int y = t; while (t--) { int cnt1 = 0; int cnt2 = 0; string s; cin >> s; string r = s; int n = s.length(); for (int i = n - 1; i >= 0; i--) { if (s[i] == 'B') { if (i >= 1 && s[i - 1] == 'A') { cnt1++; s[i] = 'C'; s[i - 1] = 'B'; } } } for (int i = 0; i < n; i++) { if (s[i] == 'B') { if (i = 1 && r[i - 1] == 'A') { cnt2++; r[i] = 'C'; r[i - 1] = 'B'; } } } cout
Please fill out the feedback form for today's PCD: forms.gle/HQ8PXj1QqLTPgLjY6
explaination for H was very intuitive !!
Thank you for the explanations. What is the notepad you use for writing?
Huion Pen tab, I don't remember the model number, it has X in its name and the number was 510 I guess
@@itzzRaghav I mean to ask about the note pad not the graphic tablet. Like do you use Microsoft note or something else?
@@kowshiqkattamuri8977 Ya it is Microsoft's OneNote free version
@@itzzRaghav ok thanks
Thanks for the video
#include
using namespace std;
int main()
{
int t;
cin >> t;
int y = t;
while (t--)
{
int cnt1 = 0;
int cnt2 = 0;
string s;
cin >> s;
string r = s;
int n = s.length();
for (int i = n - 1; i >= 0; i--)
{
if (s[i] == 'B')
{
if (i >= 1 && s[i - 1] == 'A')
{
cnt1++;
s[i] = 'C';
s[i - 1] = 'B';
}
}
}
for (int i = 0; i < n; i++)
{
if (s[i] == 'B')
{
if (i = 1 && r[i - 1] == 'A')
{
cnt2++;
r[i] = 'C';
r[i - 1] = 'B';
}
}
}
cout