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.
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?
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.
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
@ivon Indeed, corrected (as well as the associated validator).
+--------------+ +--------------+
| 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.
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|
Ok, so : i thought it didnât belong to EASY, but in fact, you donât even need to implement floodfill, I managed to compute each line separately (except for â+â where you just need adjacents cells), with just 2 flag toggling.
it is easier than it seems. Figuring out the problem is harder. Maybe you can look around to see if youâre inside? You know just look up,down,left and right. Do some counting check for trick counts.
nice puzzle ! finally get it by flooding and suppressing couch of wall 1 by one with a flag inside/outsideâŠ
but rather medium than easy!
I was wondering if it is possible to solve it using regex.
I almost sure it is not possible because of this:
â±+o±+â it can be both outside and inside, you cant tell because there are no verticality in the string. I was trying to do vertical/horizontal verification by rotating matrix, however there was multiple fault detections on last test.
If you wish to try regex here is my last itterations â[|+][^|+\n]+[|+]â.
Maybe you can make vertical verification work by adding borders around original map and reversing match result. I was able to past 7/8 tests with this aproach.
Solving this puzzle using regex will be swaggest solution imho
Not well defined task.
ooooo
-----
ooooo
-----
ooooo
Answer can be 5 and 10.