Getting wrong in all tests cases

https://ide.codingblocks.com/s/223599.Please tell me where I am wrong.

@Hk199977
for each tescase you have to print ans in new line. you forget to cout endl;
change line 37 to cout<<minSteps(a,n)<<endl;

As I can see you got 100 points, I am marking it as resolved. Thanks

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.