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.
Your solution must work for any array of any six distinct numbers in that range.
In other words, tests define the input, not you.
Quite a complex kata to understand.
You kind of answered your own question here. You used a class to avoid global variables, but your single instance of the class is a global variable.
The point of this kata is not to try find a clever work-around the rules, the point is to make a
mangle
which returns only a list, and aguess
which is able to use only that list to guess the missing number. It is tricky, but very possible.This comment is hidden because it contains spoiler information about the solution
I don't know if it's possible to answer this question without giving away the solution, but I'll ask it anyway: What does it mean when my attempted solution passes the fixed tests (which include tests of both mangled and guess functions), but in the complete test set, it only passes for the mangle function, not for the guess function?
In those failed test runs, my guess code seems to repeatedly draw its guess from only the first set of numbers it encounters. It then repeats the same guess for all subsequent tests. What would cause that?
BTW I am using a class to avoid using global variables.
Approved
took me a lot of research on currying and stuff, but great kata!
very bad description
Is this done with any 6 random numbers in that range? Can I randomly generate any 6 unique numbers and have it work?
Wow, really nice kata! No idea if my solution is the right way of solving it, but there was lot of room to play with it :D
Python translation: https://www.codewars.com/kumite/648a4975d52f51b10106b66c?sel=648a4975d52f51b10106b66c
Instead of trying to disable globals, this translation tries to check that the result depends only on the 5 numbers.
Please check vulnerability before approving.
since author is no longer active, I changed the description
Only from reading the comments, it is clear the 5 numbers to return should be taken from the original 6 numbers, not from the entire set of numbers in scope. The description is not clear about this.
"returns an array of 5 of those numbers" -> "those" could be interpreted both ways.
Loading more items...