Ad
  • Custom User Avatar

    (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.

  • Custom User Avatar

    Thank you! I changed my rating accordingly :-)

  • Custom User Avatar

    The problem has been resolved.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Custom User Avatar

    Maybe this will help for now:

    left_hand_keys = '12345!@#$%QWERTqwertASDFGasdfgZXCVBzxcvb'

    right_hand_keys = '67890^&*()YUIOPyuiopHJKLhjkl:;"'NMnm<,>.?/'

    But yes, it should be fixed.

  • Custom User Avatar

    Nice job solving your first Codewars kata! :-)

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    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...

  • Custom User Avatar

    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.

  • Custom User Avatar

    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?

  • Custom User Avatar

    Thanks a lot HerrWert

  • Custom User Avatar

    Hello! I am a Codewars bot, and I reviewed your kata for common authoring mistakes.

    Click to see the review

    Commonly occurring issues

    • 🛑 Poor language of the description: The description contains grammatical and structural errors, including ``max_threshold is floats, the fragment `Float precision using approximate tolerance`, duplicated item number `6`, and a repeated return requirement.
    • 🛑 No debugging info on failure: The submission test Basic Mixing and Clipping uses a generic title and the message Failed for basic tracks with clipping, neither of which presents the tested tracks and threshold when the assertion fails.
    • 🛑 Tests must not reuse potentially mutated inputs: In the random submission tests, tracks is passed directly to mix_audio and then reused in the assertion message. A submitted solution could mutate it, so pass a copy such as copy.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!

    • The solution stub is invalid Python because the function body contains only a comment. Add pass or another statement.
    • The description requires a list of floating-point numbers, but the complete solution does not convert unclipped sums to 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:

  • Custom User Avatar

    Bob'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...