Grand temple wrong testcases


Code works alright but on submitting all testcases are wrong. Please help :)) Thank you

Hi @aan
You are getting wrong ans because you are using wrong approach to this question. All we need to do is just store all the X and Y coordinates and then sort them. Then we will calculate maximum ΔX and ΔY where ΔX = (Xi -Xi-1) & ΔY = (Yi -Yi-1). Then the area will be (ΔY-1)*(ΔX-1)

But shouldn’t this work?? I mean the code gives the right answer… so I don’t understand… kindly explain


Kindly check the code for the errors made…

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.