Unable to understand the question "Grand Temple"

I am unable to understand this question, Can anyone tell how the answer is 2 over there?

The question is here: https://online.codingblocks.com/player/10305/content/5185

Hi @pradeep6k !
Actually , for this problem you should go with greedy approach . Acc to Question , you are basically given n*n matrix and every column line should be considered as river line . And you need to find the maximum area of land which does not intersect any river .
For implementation , you can go through this code

1 Like

can u please give its solution in java??? I am unable to understand the problem of how to take rows