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.
Great kata to practice some performance optimization on the fundamentals.
Please allow results with or without initial
(0,0)
.That initial
[0,0]
should not be there, and that is specified ( note it says "after" every step ).Not a kata issue - but I am going to raise it as a suggestion; that initial
(0,0)
can very easily be checked for and passed.( JS )
Function.prototype.toString
should be nuked altogether inPreloaded
.Just setting
_checker.toString
to something leaves the door open forFunction.prototype.toString.call(_checker)
, which still reads the source code.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.
Loading more items...