One count problem not passing some testcases

question link - https://hack.codingblocks.com/contests/c/668/916

My code link- https://ide.codingblocks.com/s/110493
It’s not passing some of the test cases, please help.
TIA :slight_smile: