hello, once again, i get 100% ide but only 60 % when submitting…
I don’t know if i m doing wrong.
here is a debug trace of how i found and demine, but i can’t really see my mistake.
??1..
??1..
11222
..1??
..1??
?.0..
.m0..
00122
..1??
..1??
?.0..
.m0..
00011
..0m?
..0.?
?.0..
.m0..
00000
..0mm
..0.?
?.0..
.m0..
00000
..0mm
..0.?
3 mines to look for, so the algorithm stop here
I am not able to understand the test case “Hidden Mines”. I discovered the possible mine locations like the following:
(* - mines)
…
…122
…2**
…3*?
…2*?
But the output considers the location of two “?” also. Could you please explain why is that? Is it because no of hidden mines (nb) in input is 6?
Note: “?” at (3,4) can be replaced with number 4 and “?” at (4,4) with number 2.
Which mines to select if input is 14 for no of hidden mines (nb) for the following example?
@codybumba
in fact you can’t resolved the last two interrogations…
but you know that they are 6 mines in total (from input) in this configuration,
and you discover 4 of them,
so the last two ‘?’ must be the last 2 mines to reach 6
I’m a bit disapointed, I thought solving this puzzle would compel me to find mines more efficiently to improve my solver for the interactive version (https://www.codingame.com/training/medium/minesweeper-1) but actually the basic check I use in the interactive version still works here and gets me 100%.
I challenged most user solutions with this very easy custom validator:
3 3
2
???
121
…
and almost none of them finds the mines (0 0 and 2 0), meaning most of us went lazy for this puzzle
Well, I don’t have much time to improve solutions of already completed puzzles (I’d like to complete all medium puzzles and it’s pretty long, 43% so far and I’m happy when I can grind 5% per week), but I’ll definitively give it a try later.
I see how this can be done, testing all combinations of mines in the neighboorhood of a digit and when only one of them doesn’t contradict the other digits, it’s the good one.
It seems pretty straightforward to implement but my code is already spaghetti-ish and if I want to add this properly I’d have to do a bit of cleaning before
I assume this is why I am failing validator 4, as I believe it is timing out because it is never able to resolve this pattern. Test case 4 doesn’t have that pattern. It’s a little bit evil that it got snuck into the validator, if so.