How is it possible for the sample test case given with the question to give an output 2 , shouldn’t it be 6?
Grand temple problem
Hi @ChiragJindal7,
in the given test case, n=3 and coordinates of river intersection are (1,1),(2,4),(5,2)
1)initially, land is
OOOOO
OOOOO
OOOOO
OOOOO
OOOOO
2)since rivers intersect at 1,1, land becomes;
XOOOO
XOOOO
XOOOO
XOOOO
XXXXX
3)since rivers intersect at 2,4, land becomes;
XOOXO
XOOXO
XOOXO
XXXXX
XXXXX
4)since rivers intersect at 5,2, land becomes;
XXXXX
XXOXO
XXOXO
XXXXX
XXXXX
Here as u can see, max area covered by consecutive O is 2, hence largest area possible is 2.
Hope dis resolves ur doubt, If u still have any queries,u can post them here
Okay sir !! Got it !!
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.