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 am a total Python noob, what is python stdout, but not system stdout?
This comment is hidden because it contains spoiler information about the solution
Unpublished due to the violation of the Codeforces license:
"It is forbidden to publish Codeforces problems in open sources supporting
automatic testing (such as online judges or similar resources)."
I think this is a very good kata that needs some additional work. For instance there's both "open" and "closed" hashes... so:
_entries
to be in the object, and then validate that, instead of validating that there's only a single list attribute._entries: list[LinkedList]
is actually being correctly populated (and so it should me mentioned in the description)._entries
key is required and validated, then there's no need for anti-cheating._entries
and expect the reading methods to work, that way cheating would make no sense at all.What does everyone else think?
A hash map is unordered by definition, which means it doesn't have key/value order, so asking
.keys
/.values
/.items
to return a tuple, a frozen list, is inappropriate. It should be at least afrozenset
, or to be precise, a view-like object.(Python didn't mandate insertion-order preservation before 3.7, so this property in view-like objects should be seen as a bonus, not a norm.)
The anti-cheat tests are pathetically weak.
I do not believe the current design of the kata would work at all, because it's trying to enforce an implementation while the tests are probing the behaviours instead.
Hashmap = {}
would satisfy all the behaviours, the kata just didn't like it ;-). To enforce a partciular implmentation you'd at least need to do these things instead:LinkedList
in Preloaded, and enforce user code to use itOtherwise you cannot make any claims that you actually know what the internal components of an unknown
Hashmap
is implemented.The description does a very poor job describing what
size
is. Is it the bucket size or the capacity (number of values it can store)?Moreover,
size
isn't directly tested at all: the tests at best do it in a very roundabout way.There are still
test.expect
assertions in the tests that do not have a message supplied, which are just displayed as an unhelpfulvalue is not what was expected
How many decimal has
4.12300000000000022026824808563105762
?And
4.123
?P.S.
Test framework and solution should be imported explicitly.
The
describe
/it
blocks' structure in the tests is wrong.The reference solution is wrong: