Move all x to an end

my code is not accepted on hackers block

https://ide.codingblocks.com/s/101513 - this is the url of the code

Hello @Ayushi21,

This is happening because you are not taking input.
You are passing the same string inside the function for all test cases.

Hope, this would help.
Give a like, if you are satisfied.

so what input i have to take. can you please tell me.

cout<<movextoend(“xabaaxxbxcx”)<<endl;

This is the statement you are executing in your code.
But, when you would submit this code, it would print the same output as your code is not taking input string.

Add these statements in your code.
string s;
getline(cin,s);
cout<<movextoend(s)<<endl;

Hope, this has cleared your doubt.
Give a like, if you are satisfied.

ok thank you . all my doubts are cleared now.

i won’t mind a like.:joy:

1 Like