I’ve been answering a question on Codechef, and I’m 99% sure that the code is correct, even though the output is still wrong. I want to know how to fix it, or if there is an error.
In such cases, you can use the “Debug my code” button to find the hidden test case on which your code is failing. See this test case.
I tried that already. I also tried the AI answer, but it said that the code was correct.
You can see the test case in my last message which was failing for your code.
The mistake in your code is that in the second condition, you are adding min of x and y to memory. But you can delete the app with higher size as well, so you should be comparing with max of x and y.
Your code will get accepted once you do that.