@@TheAI-Tutor Instead of map, we directly change the source string, and whenever 'b' or 'B' comes we change the string char that we get from stack to $. So that while output, we won't print those, assuming we have removed those chars. I rewrote the code: codeforces.com/contest/1907/submission/237917386 You can check this submission. And trace through it. You will understand.
nice job man, congrats from VN
thank you
Thank you so much,As a beginner i tried out an approach with vectors but I couldnt get close
sir tle aa rha test case 3 pr int value lene pr
@@cskakeeda12 I don't think int value would be an issue. You can share your submission to help you.
@@codingdynamo
#include
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
mapm;
string s;
cin>>s;
stackupper,lower;
for(int i=0;i
@@cskakeeda12 It's working codeforces.com/contest/1907/submission/237574208
Maybe you can share your submission link, this might be an accepted code.
there was no need to use map, insteadu could have canges directly to the input string and then do conditional traversal of it
Yes, that's the best approach 😃👍
didnt get it :( can you explain?
@@TheAI-Tutor Instead of map, we directly change the source string, and whenever 'b' or 'B' comes we change the string char that we get from stack to $. So that while output, we won't print those, assuming we have removed those chars.
I rewrote the code: codeforces.com/contest/1907/submission/237917386
You can check this submission. And trace through it. You will understand.
upload C please
Here you go, th-cam.com/video/ZfXD0lC5oXA/w-d-xo.html :)
#include
using namespace std;
#include
int main()
{
int test {};
cin >> test;
for(int r=0; r> inputstring;
char * newstring = new char[inputstring.length()];
int indexnew = 0;
for(int i =0; i=0; j--)
{
if(int(newstring[j])>=65 && int(newstring[j])=0; j--)
{
if(int(newstring[j])>=97 && int(newstring[j])