Size of grid is not given

do we have to assume the size of the grid to be max(x) * max(y) or something else? It was mentioned explicitly in the DEFKIN problem why isn’t it mentioned here

Yes.it must be mentioned…follow the problem statement of DEFKIN

@pratyush63 yeah but in DEFKIN it is given as input, here it is not, so what value should be taken?

@Ishitagambhir Size of grid don’t matter in the question.
Only consider those rectangles which are surrounded by river on all four sides.

@pratyush63 this is my code for the defkin problem https://ide.codingblocks.com/s/266933 please help me make changes in it so that grid size is not needed

Refer this https://ide.codingblocks.com/s/266943 grand temple solution. Here grid size was not considered. In DEFKIN, grid sizes were given…so you must consider that…your approach is correct and is better.

1 Like

@pratyush63 got it, thank you