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.
(Hidden) Specs shouldn't come from examples alone, unless you deliberately are creating a
puzzle. So if the spec is inadequate, feel free to post a comment about it.Thank you! I changed my rating accordingly :-)
The problem has been resolved.
This comment is hidden because it contains spoiler information about the solution
This tripped me up on a LeetCode problem recently. I was supposed to be subtracting two integers, but I mistakenly used the names of two booleans instead. It didn't cause an error, because booleans have numeric values that can be used in a subtraction operation. So I had to go over my code visually to find the mistake.
Maybe this will help for now:
left_hand_keys = '12345!@#$%QWERTqwertASDFGasdfgZXCVBzxcvb'
right_hand_keys = '67890^&*()YUIOPyuiopHJKLhjkl:;"'NMnm<,>.?/'
But yes, it should be fixed.
Nice job solving your first Codewars kata! :-)
You raise a good question. I went back and checked my solution. It seems that I passed all the tests without allowing for negative numbers. When I plugged in the input of sum = 0 and gcd = 4, my code returned neither a pair of numbers nor the -1 that was to be returned if the two numbers don't exist. It just defaulted to the return value of None, as Python does without an explicit return. So apparently, no, you don't need to consider negatives.
For one thing, almost all Codewars challenges (kata) require you to return your answer -- not just print it.
(You can still print before returning, so that you can see exactly what your code is producing as output.)
Your code isn't too far from passing the tests. Remember that you need to return a single reconstructed string.
I did have some questions on the instructions, but I answered them for myself by taking a closer look at the example. This is going to be interesting...
I tested your code myself, and I see what you are talking about. But rather than occurring randomly, it seems to only fail when the random input includes a zero-length string ('') (because there is no index 0 or index 1 in a zero-length string). If you add some code to handle that situation, I'm thinking it should pass every time.
UPDATE: I just tried it myself and confirmed that this is what is happening. The description should really explain that if the input is a zero-length string, the output should also be a zero-length string. It would also help if that were one of the sample tests.
Why did you change the tests to be so weird? What is the point of ensuring that every value in the returned list is a float and not an integer?
Thanks a lot HerrWert
Hello! I am a Codewars bot, and I reviewed your kata for common authoring mistakes.
Click to see the review
Commonly occurring issues
is floats, the fragment `Float precision using approximate tolerance`, duplicated item number `6`, and a repeated return requirement.Basic Mixing and Clippinguses a generic title and the messageFailed for basic tracks with clipping, neither of which presents the testedtracksand threshold when the assertion fails.tracksis passed directly tomix_audioand then reused in the assertion message. A submitted solution could mutate it, so pass a copy such ascopy.deepcopy(tracks)to the user solution or construct the diagnostic message before the call.Other potential problems
Note: the issues below are not an effect of studying any guidelines, and they are purely an effect of evaluation of AI. They are very likely to be inaccurate or inapplicable. Use your own judgement, and when in doubt, ask the community before fixing!
passor another statement.float; for example, integer-only tracks can produce integer elements.Please mind that I am not a very smart bot, and you should verify my remarks with any resources available for kata authors and translators:
#help-authoringchannel of Codewars DiscordBob's right (as usual). The instructions say: "If x length is less than or equal to 1 return 0 since the car didn't move."
Loading more items...