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
@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 (Coding Games and Programming Challenges to Code Better) 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.
You were right, I’ve re-written my loop in a different way. Now all tests pass but the last validation test doesn’t after submission. Nevermind, 80% looks good enough, I give up , it took me a while to pass that last test
You may send me your code by private message and I’ll take a look. Remember to format your code properly by using the </> button on the formatting toolbar.