Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Trying to solve this in C#... Simple brute method worked with sample tests, but timed out on the later test.
So i've used the Binet formula which works fine up to n = 10 and fails at n = 100.
I've used double to define phi, psi and sqrt(5), and to do phi^n, and apparently that starts to fail in lesser digits on the number.
What am I missing here?
Welp, I've made a Java translation which uses double array and wondered if that was ok for the part 1, cause I'm too lazy to do extra job if it's not entirely necessary.
Why do you return string instead of just array/list?
Not true. I've used my very same solution, just added the condition for '_' into one of the statements for part #1. That is 'identical' for me.
Why do you have two almost identical katas here...
+1 to solved :D
Blind4Basics, I know right. I meant that logics without combinations is not working.
is exactly what I meant and intended to do.
This comment is hidden because it contains spoiler information about the solution
Not really. 2 mines are hidden in the efghij and it can't be told exactly just from the opened cells, it needs to continue opening other cells and validating solution.
My bad. There should be 4 mines left, actually. Here's the original piece:
The logics you provide... It's not a simple rule like mentioned above and needs the rest of the map to be solved till the end and then mines being counted. And this can be long and tricky, if this situation is encountered in the middle of the game, not in the end. I guess it's easier to write a substitutor which will try all the combinations of mines in the border zone, remove the invalid ones and ones which have more mines than the task is, and then look for cells being same in all solutions.
Argh, I have no idea how to render that, codeblock removes newlines and regular text isn't monospaced...
Last rule meant
if A ⊃ B & hiddenMines(A) - hiddenMines(B) == count(A - B) ⇒ A - B is mines
Welp, I'm stuck here. My solution already has logics for
if A ⊃ B & hiddenMines(A) == hiddenMines(B) ⇒ A - B is safe
, A and B being ? zones around opened cells. I've even gone further and implemented logics forif A ⊃ B & A ⊃ C & hiddenMines(A) == hiddenMines(B) + hiddenMines(C) ⇒ A - B - C is safe
and also logics forif A ⊃ B & hiddenMines(A) - hiddenMines(B) == count(A - B)
but yet I'm stuck at map #6 (I believe) in moreDifficultTests, 87 mines, 29x30. I have just 3 mines left and the area looks like1 1 1 1 x 2 1 1 0 0 0 0
2 2 1 1 1 2 x 2 1 1 1 1
x x 2 2 2 2 3 ? ? 1 ? ?
x ? ? ? ? ? ? x 2 1 1 1
My previous solution would did substitute here, just shoving mines in every bordering cell and then validating the combinations, and then intersecting solutions to find safe cells, but it was messy so I started over and would rather stay away from that. Is there any other logical rule I'm missing, or there needs to be a substitution part?
'Expected', not 'Excpected' q:
Btw, u got a type there.
Never mind, there was an extra newline in the end. I found that out and was going to mark issue resolved, but you were faster.
There are no \n here because SW shrank the code.
Loading more items...