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.
Kata is now retired.
This comment is hidden because it contains spoiler information about the solution
I know I'm 2 years late, but I saw your comment and noticed you still don't have a solution.
I found it helps to understand the algorithm if you do some examples by hand.
If you encode "Mellow Yellow" and "Melllow Yelow" by hand, you should see a difference.
Java
what language?
Because only python 2 is available, and
/
is integer division in python 2...This is a nice simple kata, but has some issues with the test cases:
int
variable to track both the east/west difference and the north/south difference. Such solutions would fail to either "eeeeennnnn" or "eeeeesssss" but have passed. For this reason, you need to test specifically for walks of the correct length which place you at a wrong spot directly north-east (or north-west, south-east, south-west) of the start.Although this code passed the tests, it shouldn't have: Go 5 blocks north, then 5 blocks east and we're not where we started but this code says we are!
Being easy isn't an issue.
There's already a function in Python that returns the type of an object, called
type
. When the tests for this kata are run, it's just executingcheck_type(some_object)
. By giving the existingtype
function the additional namecheck_type
, that line of code will use the builtintype
.How does this work ?
You're leaking memory in
popFirst()
: the node thatl->head
used to point to will never be deallocated.wow!! I love this solution!! Happy katas! :)
Actually if you use Decimal("...") instead of float("...") for your calculations, just converting the final result back to float type works.
@g964 what do you mean by preloaded section?
Loading more items...