Move all x at end ques

https://ide.geeksforgeeks.org/IXn9zgKSzD
why is it returning garbage value for count of x