Broken calculator

getting an error please check the code

Crosscheck the approach from here if you are getting a wrong answer.
If there is some run time error or so…then save your code on ide.codingblocks.com and share its link.

check my code

Increase MAX to 10^5 and then check.

Already done but still giving TLE

I checked your code. It is passing all cases on my side.
Check by submitting here https://hack.codingblocks.com/app/practice/1/325/problem

oh yeah this time it passed I don’t know how, thanks for resolving the doubt