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.
Thanks for the response. I agree that your threshold is not unreasonable, but it would be nice if it was stated in the problem. It does feel kinda of bad to have to run the code a few times until you pass based on how your Random Generator calls go. Or perhaps you could edit the error message from the test to says "There are > 10% duplicates" or something. Ideally, I'd love for you to add the 10% threshold in the challenge text and the error message.
they don't need to be unique actually, the solution space is something like 255 * 255 * 255 different colors length and I'm just testing a couple thousands using the standard rng. For a real life scenario you'd probably want that your solution ca be able to generate all the possible colors and not just a subset. Doing so and verifying for such Hamiltonian path are also NP complete problems. Some people are ready for that challenge but not all of them. Your solution as validated here just has to be testable in terms of reproducibility, the pseudo rng for the tests actually allows (and most likely also generates) duplicates it only checks that something like the 10% of the whole possible colors are different, and that for me is a very reasonable number of duplicates allowed.
Same in Ruby, in 2021! One subtlety to add though, as a suggestion: perhaps the 'Randomizer' test could be adjusted to accomodate a more reasonable number of duplicates. It is fairly shocking how many perfectly random coin-tosses come up consecutively heads or tails, and while pseudo-random numbers generated by computers are not perfect, they are actually pretty good nowadays! I see my solution got through on about the sixth or seventh attempt, so it was deemed random enough, but not every time. Not ideal, but not the end of the world either. I would suggest an adjustment.
In Java, getting a failed test saying "there are duplicates", followed by one of the randomly generated strings. The question does not say that they all need to be unique, only that they be valid. Add that to description or change this test.