FENCING - April Long Challenge

A single fence is defined by a pair of side-adjacent cells. This means that fences can only be internal. So any fence between a cell and the outside world should not be counted, right?

Consider this example with rows = 2, cols = 4

…x
….

Cell (1,5) is part of the outside world. We would not need a fence wall between the cell (1, 4) and (1, 5), right?

1 Like

You are supposed to ask your doubts on repective page of the question for on going contests

As a matter of fact you will, check the given test case.

No one replies there. Its better to ask here. :upside_down_face:

I also agree. Problem statement is not clear.

Problem statement is very much clear.

Sorry, the statement does sound misleading in this case. ‘outside world’ is considered to be filled with weeds.

2 Likes