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.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
there is nothing to replace because None gets returned if the path is not valid
This is most commonly used in electrical engineering.
Instead of incrementing bits (representing switches) by their integer value, you want to increment them so that only one bit/switch changes.
That way you prevent two switches to change at the "same" time, resulting in inaccurate measurements.
This is called "single-distance codes".
The Gray Code is one possibility to arrange your bit range exactly like that and can be used in accurate position encoding.
In this kata we wrote a function to give the integer value of the numth position of the gray code.
Though I'm not sure what that integer would be used for.. the inverse does give the current position during incrementation.
This comment is hidden because it contains spoiler information about the solution
The pre defined function takes n as an argument, not num. The descrepancy between the description and the pre written code is a bit confusing.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
very clear solution, thanks
This comment is hidden because it contains spoiler information about the solution
Just writing new code is not the intention of this kata I think.
Most pythonic solution to the task itself, though.
Well.. this is not a problem i am interested in when learning to code.
The solution is pure math and has very little to do with coding skills.
Though the math can be interesting in itself..
I like the way you formatted the list comprehension to be more readable.
But why not just use for loops instead? Is it that less performant?
Loading more items...