5 kyu
Chain Reaction - Minimum Bombs Needed
51saudiGuy
Loading description...
Algorithms
Matrix
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
now that the prequel has been unpublished, the link in the description should be removed (also: see issue 2 posts below)
Cheers
done.
The reference solution sometimes times out when running against itself in the random tests...
Looks like your solution is the fastest of them all. I will use your solution as the reference solution now. It won't happen again.
This is supposed to be a NP-hard problem, so I wonder... either the rank is wrong, or the inputs are very small, or there is a problem in the way the tests are done...?
There are no real performance constraints. Even the "advanced" version, which is back to draft had no real perf constraints.
define "real"...
100 random tests with grids from 3x3 to 7x7. No specific type of algorithm is required to solve this kata. Current solutions display a range of algorithms to pick from.
.
Hi,
in the initial solution. On CW, systematically use space characters, never tabs. (this comes from your IDE settings: you're pasting the code in the kata editor with those tabs)
cheers
i think i have corrected now..
.
Probably people have noticed this, the time a solution takes seems to vary quite a bit on the random tests you happen to get... Not necessarily an issue, I have seen at least one other kata that suggests attempting more than once just in case you were unlucky with a particularly hard random test.
Random tests should be as stable as possible. So perhaps the author should deal with this.
Sorry I'm a little bit newb lol, I suspect now it is the reference solution responsible mainly for this fluctuation when testing.
Ref sol is still wrong:
(The currently posted solutions are therefore also wrong in the same way, so don't copy from them)
A very simple case which shows this is:
After you fix your solution you should add this case as a sample test.
This comment has been hidden.
ref sol is wrong:
corrected now.
It seems like you updated the author solution, but not the solution used in the random tests to get the expected answer. However even the new author solution still seems wrong.