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.
Thanks. Inattention is my credo:)
[-0.21170577194406404, -37.78829422805593] should equal [-37.78829422805593, -0.21170577194406448]
please make the comparison approximate
and may be some rules for the order of the roots (or even better, take the roots in any order, and check the sorted roots in the test)
Python translation
tag this kata as
Strings
The specialty of this kata is not a real search for duplicates or uniques, but the use of the property that in the list there are only numbers 1 to some n, without holes, sequentially (not random from any numbers).
On this basis, you can make some assumptions, evaluate some properties of the list, without building a set() or a list of " seen duplicates" etc.
PS. oh, I saw that this is a complaint about the tests passing suboptimal algorithms, so they work very quickly, even set(inList). not just asking for a hint
lets convert
02|15|59, 2|47|16, 02|17|20, 2|32|34, 2|32|34, 2|17|17
to seconds. and sorted timings are:8159, 8237, 8240, 9154, 9154, 10036
loooks like your algorithm decided to take 8240 as value for median, but here is not even number of items. so median is - average between 8240 an 9154 (check median definition from kata details)
Python translation
I totally understand. It was a joke.
import pandas as pd
Q: Why are you importing pandas?
A: The task requires analysis, and what kind of analyst am I without a pandas?
reminded me of a story, "Laboratory Chronicles". where there was something like:
in the documentation we have pressure in megapascals, but how could they know that the graduation on our pressure gauge was in pounds per square inch.
This comment is hidden because it contains spoiler information about the solution
when it seems you are doing the right thing and tests says no.
then you make such hard code
and the tests say that they don't care what you return.
Python translation
Python translation
Python translation
I don't know if it is possible in python not to create an instance of the class or the class itself to be able to address its attributes.
therefore, you have to make the NumClass itself, and in the tests create instance Num = NumClass(), on which the tests are made.
It is also possible to discuss the need to implement dunder methods for comparison (equality), arithmetic. because it wasn't in the original kata.
Loading more items...