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.
Super clean and readable!
Fixed.
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
.Why is this an issue? its more of a suggestion.
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.
By exactly same Kata rules.
Why?
That cockroach will head RIGHT (as you look at the floor). Then it will hit the right-side wall. Then it will turn left (from the bugs POV) which means it will go into hole #2
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.
Loading more items...