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.
The statistics module doesn't accept non-positive (zero and negative numbers). It also performs operation on floats and doesn't guarantee exact results. See here.
Tests for mutation should be using identity (
a is b
) instead of equality (a == b
). Two piles can be equal is their data is the same, and this also enables some interesting options that subclass other immutable types such astuple
andstr
.Starting code for python translation has a variable
r
while kata description specifies variablea
.This comment is hidden because it contains spoiler information about the solution
Imagine that each non list item has a default depth of zero. A sublist will have a depth of 1 (itself) plus the maximum depth between each of its items.
Thus, you get with the recurrence formula
depth = 1 + max(depth(item) for item in list)
Recursively, this person's code calculates the depth of each item within the argument
l
and adds1
for the depth ofl
itself.Because it will see hole number #9 to it's right while doing so running towards the wall. Or should it be blind to its sides while running towards its first wall, but able to see normally elsewhere?
Just tested it, and it seems all cockroaches are blind to their sides and diagonals until their first turn. I think it'd be better to specify it in the kata description, as well as what's the expected priority.
I don't understand how random tests are supposed to work, in this case it says there is no cockroach that'd enter the 9th hole, but shouldn't roach R on the last line be able to?
Random tests in Python expect a single specific path while providing a graph with multiple valid shortest paths.
You can read more here: https://www.postgresql.org/docs/current/functions-srf.html
It works because
self.area
ofRectangle
is defined within the parent classShape
There is no fixed test for Nearly There, my code passed all tests despite being wrong.
bc
stands forbasic calculator
Either way you'd have to loop through all digits, and
Counter
has at most ten keys.I think the kata description should've mentioned that labels/coroutines themselves can be "run over" and the program should just ignore them. I've spent a lot of unnecessary time trying to wrap my head around that recursive power function due to this (@Blind4Basics and @AnitaK comments helped a lot, but all necessary information should be available in the kata description or tests).
Also, even though it's not tested, I think the kata's description should mention that indentation has no particular meaning, since that implies labels/coroutines can be nested.
This kata needs better tests, some examples have multiple valid paths.
Given miner
M
, exitE
and open path0
:Loading more items...