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.
I may have not completely understood the instructions, but why would
solve("czaccb")
give"czab"
instead of"zacb"
?I naively thought that you should use a rolling algorithm to remove each duplicate beginning on the left side :
edit : this algorithm works with the second example
What am I getting wrong?
should include some examples where equation starts with a negative number. e.g.
-2*3
etc.Use appropriate datatypes. Python has arbitrary precision ints, so this non-standard encoding is unnecessary.
Description should be language-agnostic.
The note part can be simplified to the 2nd argument will always be greater than or equal to the 1st one.
Python: v3.11 is required.
Missing solution and framework import in Python's tests and sample tests
Python random testing allows for an insufficient solution to intermittantly pass. High enough values, such as
n = 525194
should be guaranteed to be passed to the user.350417903 866449540
[11, 27601766442010420] should equal None
I have received that in the test attempts, with several different cases. I believe that in those cases the"None" is wrong
Hi,
Good one, but hard (like most of the time with you). I've got the longest solution so far, but the fastest as well, so... at least I didn't lose my time.
There is... this in the sample tests:
print(disputes([['#']]))
, which is useless and invalid (and makes solutions fail)Missing sample and fixed tests:
More sample tests could be a good idea as well, but I think with the 2 above that could be enough. Note that you could increase easily the number of sample tests by rotating the grids (actually useful for my approach only, but...)
The stress tests have to be put after the batch of small random tests (at least) => the test suite could be split differently so that the perf checks are all done last. Something like:
describe: warm up
it: fixed tests
it: small random tests
it: medium random tests
describe: performance tests
it: stress tests
it: random tests
The batch of small random tests has to be extnded to at least 50 tests. It costs no time at all, and allow to properly debug the solution (I actually discovered the edge cases above by chance, running a fork. My code was passing all other tests otherwise)
The specs of each batch have to be at least hinted in the description:
Cheers!
Edit: oh, and this fixed test must be added as well. Very important...
not enough small random tests (but WHY 3 only!???):
the acutal profile of the random tests aren't given (how many tests of this or that kind / typical sizes, but typical number of groups as well)
the stress test should be described as well
Missing an edge case where every land is unclaimed (the map is full of
#
). The expected result should clearly be(0, 0)
, but all existing solutions (except mine) fail at this case.(This is not ruled out by the description, and logically has no reasons to be excluded. Some lands could just be that pure ;-))
Perhaps include a larger non-symmetrical sample test?
Why 1-based indices in Python?
The input range is missing. How big can
max_x
,max_y
andnum_reflections
be? How big is the coordinates ofpoint
, and can they be 0 or negative?Hey!! I'm a bit overwhelmed by this interesting Kata. I have come up with a solution but it is some seconds slower than expected. Any help for someone like me with no idea of algorithms??
Thanksss!!
Loading more items...