getting runtime error on testcase 11
Exit code is -1073741819
here is my code:
include
include<string.h>
include
using namespace std; int main() { string lame=""; string a,b="",c=""; int i,j,n; getline(cin,a);
for(i=0;i<a.length();i++)
b[i]=a[i];
sort(a.begin(),a.end());j=0;
for(i=0;i<a.length();i++)
{
if(b[i]!=a[j])
{
lame.push_back(b[i]);
}
else
{
c.push_back(a[j]);
j++;
}
}
if(lame.length()!=0)
{
reverse(lame.begin(),lame.end());
c=c+lame;
}
cout<<c<<endl;
return 0;
}