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.
You haven't written anything for your kata beyond the title. Please actually finish writing your kata before publishing to beta.
Random tests are needed.
The unit of
x
andphase
is not mentioned. They're apparently different (x
is in angular wavenumber,phase
is in radians)This comment is hidden because it contains spoiler information about the solution
Tests strictly requires return type to be a
set
, rather than a sequence (which would be a iterable). A set is also not a sequence, so the output as specified by the description is misleading.This comment is hidden because it contains spoiler information about the solution
Looks good now
This is supposed to be a performance kata but author solution (aka reference solution) is inadequate: it is
O(log(n)*k)
even though a relatively simpleO(log(n)*log(k))
solution exists, as demonstrated by some solutions. The random tests are slowed by a lot by the reference solution as a result.Please replace the reference solution with an algorithm with optimal time complexity and bump up the range of
k
to make sure this is enforced.Please fix the sample tests:
There should be specifically a set of random tests that probe solutions against these overlapping cases.
Yes, but if the random tests can be passed by a simplier, incorrect algorithm then the random tests are too weak, which is the issue here.
Notably, I can still pass the entire suite with my incorrect solution just by hardcoding for the 2 additional fixed tests.
Why
x
needs to be unique? Yes, every solution except mine can't handle non-unique solutions (e.ga = 6, b = 24
), but then you're arbitrarily limiting inputa
to be odd, and it doesn't add anything to a correct solution since the test accepts all correctx
s anyway (it only checksa * x == b
).run_test_case
is frompreloaded
, notsolution
.solution
implicitly importspreloaded
, but importing it fromsolution
means user can supply their own implementation which overwrites the entire testing mechanism.Actual tests aren't random. It's testing a fixed, linear sequence of numbers.
Loading more items...