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.
Dunno. This solution is only 50 KB, barely longer, than listing a dict with 4000 exceptions in reference solution :D
Seems fine, although I wonder, why older solutions are validated again
This comment is hidden because it contains spoiler information about the solution
Please, do not use such approaches, this is considered cheating on Codewars.
Do not use rounding or formatting floating point numbers to string with fixed precision, this is a bad practice
Use
assert_approx_equals
https://docs.codewars.com/authoring/recipes/floating-point#do-not-use-rounding-or-stringification-to-work-around-problems-with-precision
That is even worse. You should better use
assert_approx_equals
without roundinghttps://docs.codewars.com/authoring/recipes/floating-point#do-not-use-rounding-or-stringification-to-work-around-problems-with-precision
You still round values in
expected
in tests, which still forces user to round as well, because relative error is less, than order of roundingThere is no need to force user to round the result, since you test with
assert_approx_equals
This comment is hidden because it contains spoiler information about the solution
I'm not sure it's feasible to do on Codewars. The methods, derived from Dixon method, would only be effective for large numbers (let's say, above 64 digits), for smaller numbers other methods (such as https://en.wikipedia.org/wiki/Shanks%27s_square_forms_factorization) are faster.
Factorizing something like
2^64
would not fit into Codewars 12s test suite, whereas if I take smaller numbers, users may exploit faster methods to achieve the same task..
In Python version, reference solution sometimes expects false, when path exists
We, gentlemen, don't cheat here
Duplicate to many prime factorization katas on Codewars, such as
https://www.codewars.com/kata/534a0c100d03ad9772000539
https://www.codewars.com/kata/542f3d5fd002f86efc00081a
https://docs.codewars.com/authoring/guidelines/submission-tests#input-mutation
Loading more items...