[Community Puzzle] A mountain of a mole hill

https://www.codingame.com/training/easy/a-mountain-of-a-mole-hill

Send your feedback or ask for help here!

Created by @Humanosaure,validated by @IAmNoob,@TBali and @WINWINWIN.
If you have any issues, feel free to ping them.

Why is this thing in easy section??

Because it’s a simple flood fill?

1 Like

I did use a ‘simple flood fill’, but I guess you would agree that cases with nested gardens and/or moles everywhere introduce some complications one has to think through. Also, there are solutions that are much neater than flood fill; finding these requires a bit more thinking. Some of the puzzles in the easy section are borderline trivial, so I can at least understand why someone might wonder whether this is the right category.

1 Like

I agree with docri that it is more complex than it looks. Quite at the upper edge of ‘easy’. Or 'medium ’ would have been also appropriate.
But it is exactly these ‘matryoshka-style’ and ‘full-of-holes-without-grass’ test cases, which make this puzzle interesting.

I am not sure that the [3,13] (0 based) corner(+) in the Zzzzz… test is necessary, and it introduce an error in my simple solution

1 Like

@ivon Indeed, corrected (as well as the associated validator).

diff
+--------------+        +--------------+
|    o       o |        |    o       o |
+----------+  ++        +----------+  ++
..........++ ++.        ..........++ ++.
....o....++ ++..        ....o....++ ++..
........++ ++...        ........++ ++...
.......++ ++....        .......++ ++....
.oo...++o++...o.        .oo...++o++...o.
.....++ ++......        .....++ ++......
....++ ++.......        ....++ ++.......
...++ ++....oo..        ...++ ++....oo..
..++ ++....o....        ..++ ++....o....
.++ ++..........        .++ ++..........
++o++----------+      | ++o +----------+
|       o      |        |       o      |
+--------------+        +--------------+

Not easy at all. Rather medium.

1 Like

Hi, beginner here. I am having issues with the last 3 test cases, and it’s generally due to the way I try to find the starting point for the floodfill algorithm

Any advice or high-level psuedo code to identify where i should start my floodfill?

Add two lines full of dots, one at the start, one at the end.
Add also a dot starting each line and another one ending each line.
It may help.

Thanks, was a big clue

Hello , I have issues with my two last cases , someone can help me ? o guide me?

What are the issues ? (I didn’t check the puzzle)

I did a solution that works and it pass all validations but “The Boss Validation”, anyone know whats that ?

It is very similar to the “How did THAT happen?” IDE test.
It has a fence part shaped like this, which the IDE test counterpart does not have:

...-+oo
...o+-+
...ooo|