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.
This comment is hidden because it contains spoiler information about the solution
We need to see your code to know why it fails.
Hello. I faced a problem while solving a JS task: tests [3, 5, 4, "It is possible to reach n=4 liters in one jug"] fail. The correct answer [3, 4] is specified in the task description, I even tried to substitute it manually into the return, but it didn't work. It looks like there is an issue in the _checker function in the tests. The test fails with this error:
TypeError: l.at(...).includes is not a function
at _checker (test.js:17:17)
at act (test.js:177:19)
at Context. (test.js:166:13)
at process.processImmediate (node:internal/timers:471:21)
Translated with DeepL.com (free version)
fixed
approved to avoid merge conflicts later on
this should be fixed before approving the JS translation
So unfortunately there is an easy way to break this and succeed at all of the tests:
def wpp(a, b, n):
if n > b and n > a:
return []
if (not a % 2 and not b % 2 and n % 2) or ((not a % b or not b % a) and not n % 2 and n < a and n < b):
return []
return [(n, min(a, b))]
JS Translation
Thanks. ;)
Fixed your assertions. This issue is now solved.
I implemented a fix. Your solution now passes.
Approved by someone
For input:
[[92, -34, 20, -9266], [12, 87, -3, 1857], [7, -14, 52, 107]]
, I get (more than fifty times) something like([-93.0000002363559, 35.00000016189152, 24.00000007540332], 6)
should equal([-93.0000002363559, 35.00000016189153, 24.00000007540332], 6)
Something has to be done about accuracy :
35.00000016189152
->35.00000016189153
Rejected by one of the mods ^^
This comment is hidden because it contains spoiler information about the solution
Loading more items...