Feel free to send your feedback or ask some help here!
How is it possible that more than four dominoes fall in the βsimpleβ test case?
| | | /
\ | | \
- | | -
- | . -
The three dominoes on top left fall, then the one on the top right and it stops.
The one on the top right falls on the one below.
Ha, I thought that such a move was impossible.
I pass everything but the last validator after submit. my dominoes fall in order, Iβm not so certain that order doesnβt matter. What trickery is involved in the last validator? Iβve accounted for the first space being empty, so that shouldnβt be it. I guess it could be timing out, but i doubt it - itβs not that complex. Iβm basically just doing a flood fill, with a stack . No fancy classes. I even use an array instead of a bunch of if statements eg. $dirs=[βLEFTβ =>[β|β=>true ,β-β=>false,β\β=>true ,β/β=>true ],
βRIGHTβ=>[β|β=>true ,β-β=>false,β\β=>true ,β/β=>true ],
βTOPβ =>[β|β=>false,β-β=>true ,β\β=>true ,β/β=>true ],
βBOTβ =>[β|β=>false,β-β=>true ,β\β=>true ,β/β=>true ],
βTLβ =>[β|β=>true ,β-β=>true ,β\β=>false,β/β=>true ],
βTRβ =>[β|β=>true ,β-β=>true ,β\β=>true ,β/β=>false],
βBLβ =>[β|β=>true ,β-β=>true ,β\β=>true ,β/β=>false],
βBRβ =>[β|β=>true ,β-β=>true ,β\β=>false,β/β=>true ]];
Yes, Iβm using php. Help?
Hi there,
I am not sure that order matters - I tried it using DFS instead of BFS (my original solution) and there is no difference.
As for the last validator, I donβt think there is anything particular about it.
I hope this helps.
Having the same problem as Patrick above. Pass all tests and validators except the last one. Iβve tested a bunch of edge cases in the IDE, coded an empty starting space, tried hard coding 0, NN, NN-1 as the answer, none of this can get me past the last validator. Any hint would be much appreciated.
Sorry, I missed to mention it on the forum.
@LastRick struggled with validator 5. He found the bug and provided an additional testcase (causing an infinite loop for the buggy solution) which I added to the end.
perfect, thanks!
Hello, in my case all the tests work, and all the validators too,exept the first oneβ¦And i have no idea why; Can someone help me?
Try a Custom test case:
4
| / | /
. . \ -
. | . \
. | | \
Expected output:
2
To run Custom test cases you need to enable Expert mode is settings.
Youβre right, I also think of thatβ¦