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.
I also found debugging was not easy during main tests. What you can do is, inside the body of each method, print messages that allow you to know first which method is called, and then whatever you're interested in (arguments received by the method, state of the list at the beginning, state of the list after applying the method...). This way you may find out which operation your code is not doing right.
Please use spoiler flag next time.
This comment is hidden because it contains spoiler information about the solution
So I generally agree with the sentiment (especially with geometry/physics katas) but the sum of the first n numbers is such an important formula in the study of algorithms that I think it deserves its place here.
Total average is the average of all valid values:
so true, after this kata i use filter with no math in
Exactly what it says in the description. Random lists are generated, random indexes are called, and random methods are used on the lists. This isn't unusual for a kata. If need be, test it locally. :)
I have no idea what is happening in random tests and how to debug them.
Man, this is a much clearer description
As I understood it [0, 4] are X coordinates and [0, 0] are corresponding Ys.
It's
(0,4)
not(4,0)
, order matters.Python
AFAIK Manhattan distance is calculated |x2-x1| + |y2-y1|.
So at (0,3) with supplys at (0,0) and (4,0) I got:
and
But the answer is 1. Did I misunderstand something? TIA.
AFAICT that is also a magic square. So why isn't it an acceptable answer?
I can't agree more on that mate!
Python,
As I understood it:
Loading more items...