where my code going wrong https://www.codechef.com/viewsolution/10869822.
We are not your servants. Do the effort of explaining your solution and what you’ve worked out so far if you want us to pursue the effort of helping you.
You should debug your code yourself.
If needed, you can check other people’s solution, generate test case and match your output with their output.
But, don’t ask others to tell you your mistakes.