I am unable to find out the required approach to solve the question. Need help.
Need help with the approach GRAND Temple
@saurabhpandey59373 In this question you are given that there are some watchtowers at different coordinates (x,y). Now 2 rivers flow horizontally and vertically and they intersect at this tower
Here you can see that there are 3 towers at (8,6), (3,8) and (11,2) and for each of them 2 rivers (1 horizontal and the other vertical and flowing and intersecting at the respective (x,y)).
Given this arrangement the rest of the space left in the grid(the white portion in image) is land.
Now the king wants to build a temple and he wants to do that on the largest area available. Now you are required to find out and print the area of the largest land which is available and in which the king can build a temple.
now you are supposed to find the max area, and for having an area you must have a rectangle for that you will need 4 points and for given test case we found that 2,2), (2,4), (5,2), (5,4) these are the 4 points which will give us the maximum area. There is one thing you need to keep in mind while calculating the area i.e. the area will be calculated from the edge next to the left edge, the edge above the bottom edge, the topmost edge and the rightmost edge, therefore for the region (2,2) , (2,4) , (5,2) , (5,4) the actual area will be considered from (3,2), (3,4), (5,2), (5,4) respectively.
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.