Grand temple problem

please explain the problem and the sample test cases…

In this problem you will be given points by user. For each point entire row and column will be considered as river. Now you have to find the max area present between the rivers. hhnZpEJ
In the image you can see that grey colour row and column represents the river and now to have to code accordingly so as to find the max area present. ( which is the white area present in the image )

sir how can if apply binary search in this question, I think this can be solved without using that.

This is a pretty simple problem. 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)

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.

sir, but why are we taking difference of any two continuous coordinates?

Xi and Xi-1 are not continuos coordinates.
Xi is the ith coordinate and Xi-1 is i-1th coordinate where i goes from 1 to n, n = no. of input points. Same goes for Y.

Hope this helps
Mark resolved if satisfied :slight_smile: