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.
The details define the boundaries as "Given a number as a parameter (between 2 and 30)", while in reality the tests contain the values up to 100.
Yes, it passes the "Remove empty branches, after unlocking" section.
Though, the solution is submitted now, I was experiencing random failures of 1-2 random tests and that's where I couldn't spot, what the issue is :-|
To further clarify, I'm doing this kata using Ruby, the solution passes all the basic tests, around 20% of the random tests, and just one (Throw an EmptyMolecule exception when no branches are left after unlocking) test out of the "Behaviors related to the "unlock" method" section.
Another question: should the branches be renumbered as well and if yes - should this happen during the "unlock" or upon mutation of the branch first element?
Update: It seems that I got it, all the Hydrogens suppose to be removed regardless whether they are added on "closer" or mutated, so now my solution passes all the non-random tests, however it passes only 20 to 30% of random tests, hence the question - how do I properly debug that given that the outcome of the tests is truncated and the visible part seems to be equal?
More specific question is about the following sequence of events:
My code throws an
InvalidBond
exception on the attempt to mutate toBr
and therefore ignores mutation toS
.As an outcome of these events, my code returns
formula
asC11H22P
andmolecule.atoms
aswhich is considered invalid, but I'm wondering what is a valid result, so that I could try to debug my code.
Okay, I found an issue in my code where I didn't remove the improperly created bond on one side when it failed on the other side, but now I have the problem that my solution fails randomly for 1-2 of random tests, though may pass if I try "attempt" several times.
@Blind4Basics, I'm struggling with the
unlock
method - it says "Hydrogens should be removed, as well as any empty branch you might encounter during the process.", but it doesn't specify if this applies only to the Hydrogens that were added during thecloser
method or any Hydrogens including the ones that were added viaadd
,add_chaining
andmutate
.The tests aren't explicit enough to understand what exactly is wrong with the molecule in the 'Behaviors related to the "unlock" method' section.
I've tried different approaches (deleting all Hydrogens vs deleting only the ones that were added by closer), but the tests starting from
All hydrogens should have been removed after closing/unlocking and carbons ids modified accordingly
fail anyway.Any hint/clarification on the
unlock
method expected behavior?@Erhu, proving that sudoku has multiple solution may be done in different ways and one of them is not that time-consuming.
Think of what it means that there are several solutions in terms of the resulting elements positions & values.
AFAIU, if you have a sudoku with zero empty (zeroed) cells, which doesn't require to be solved, it should be marked as invalid.
I'd say that there's not enough tests for a larger inputs (e.g. at least 10^6+ elements).
That's not true, unless the century suppose to start from year zero.
https://aa.usno.navy.mil/faq/millennium#:~:text=By%20extrapolation%2C%20the%2020th%20century,continue%20through%2031%20December%202100.
You're right, 3*9 = 27, £ == -1, so 27+(-1) == 26
The description or basic tests are lacking the examples of the sentences, because initially the user may think that "vs" is the only type of thing to appear between the team names.
Ruby translation, if you don't mind :)
Ruby version of a Kata fails when Attempting to submit a solution with:
So, apparently, it looks like it's a solution issue rather than the Kata one, but this isn't obviously clear from the error messages and I believe it worth to improve the tests to avoid crashing like this in case of "inappropriate" solution.
There's an issue with random tests on Ruby.
It shows the error message when trying to submit.
Adding "require 'set'" to the solution solves the problem, but I am not using 'set' in my solution, so it seems that the reference solution simply forces me to require an unnecessary module.
I believe that's because 493039 == 79**3, so it shouldn't be an issue.
Nice kata, but it lacks the tests with larger values, at least 20 dice of 20-sides.