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.
issue fixed
Fork here which addresses the following problems in JS:
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 :-|
ok, one part (at least...) of the spec is missing for the branch removal. You're supposed make the branches "contiguous again", after removal of empty branches. Aka, if you remove branch 3, branch 4 is now considered branch 3. (edit: added to the description)
Does your code pass the tests in the
Remove empty branches, after unlocking
section? because that's where this behavior is tested.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.
I cannot look into this right now. But maybe the thread just below yours might help (a bit)
@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
"For example, the number 26 as an input should return 3^"
Is this correct or should it be '3£' ?
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.
Loading more items...