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 tests should limit the imports from the solution to only those being tested, as any defined helpers may clash with names in the tests.
I appreciate the use of
fix
, but doesn't using(++)
inappend'
kinda defeat the purpose?Python: No random tests
Even though the tests don't test for this, you should probably replace
'|'.join(forbidden_words)
with
'|'.join(map(re.escape, forbidden_words))
to avoid errors if any word in
forbidden_words
contains regex metacharacters.While it's not the simplest, I'm proud of the time complexity of my solution. Once the trie is populated, each call of
check1800
runs in constant time, since phone number length is constant.Randomized testing in Haskell (and maybe other languages) can result in the following:
The description lacks enough detail to determine sorting behavior between letters and characters whose ASCII value falls between the upper and lowercase letter ranges:
[\]^_`
This comment is hidden because it contains spoiler information about the solution
I've forked the Haskell translation here to add random cases and clean a few things up.
Sample tests in Haskell fail due to a faulty function signature. I've put in a translation here that fixes it.
(?)
in sample tests.My previous solution didn't take advantage of the fact that the commands would keep the robot in the space of non-negative coordinates.
Integer
.Test 6 in the sample tests uses the following input
items = [(2, 3), (6, 5), (8, 2), (4, 5), (2, 8), (5, 5), (2, 2)], w_limit=7
and expects the following answer
[13, [[2, 3, 8], [5, 8]]]
.There are two different ways to pick items with values of
[5,8]
that weigh less than7
. It is not obvious that these two ways should be combined in the output.Sounds good to me
I agree. No need to reinvent the wheel :)
Loading more items...