Can you please provide a brief introduction
Not able to understand the problem statement
Hello @sharad1103,
Let’s take the example of the given question.
The x-coordinates are {1,2,5} and the y-coordinates are {1,4,2}.
Since the river is flowing till infinite through the given points, it is safe to write the given co-ordinates in sorted order. So, x = {1,2,5} and y = {1,2,4}.
Now we have to find the largest length and largest breadth because they will give the largest area.
For length, we will subtract consecutive elements of y.
As (4-2) > (2-1), our largest_length = (4-2-1), we are subtracting 1 from the result because the river is flowing through the 4th co-ordinate as well and we can’t count that.
Therefore, largest_length = 4-2-1 = 1.
For breadth, we will similarly subtract the consecutive elements of x.
Since (5-2) > (2-1), our largest_breadth will be (5-2-1), reducing 1 for the similar reasons as of the largest_length, therefore, largest_breadth = 2.
Now that we have the largest_length and largest_breadth, we can easily find out the area for the grand temple.
Hence, the area = largest_lengthlargest_breadth = 12 = 2.
Hope this helps.
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.