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.
It would be nice if the solution didn't take 6 seconds to solve, it really made me confused that my solution was that slow, until I realised that mine wasn't the problem.
The Tao of Programming right here
I pressed "attempt" 30 times :)
This comment is hidden because it contains spoiler information about the solution
I mean, that works, but it's kind of a shitty fix.
I feel like the best solution to this problem would be to make sure that there are at least something like
20
tests where the answers should be1
,2
, '3', and4
. Then you can leave some extra20
tests that are fully random.It shouldn't be too hard to create a test for a given number of squares.
You can even do something lazy like this:
Then maybe shuffle the tests around so they can't be hardcoded.
there were only
15
random tests in Python, i bumped it to100
. your and akar-0's solutions do not pass anymore, but i dont know if that's enough, your solutions only fail around 15 random tests each timeIt would be better if someone fixed the issue, lol.
closing then, only one issue should be kept
Yeah, it's the same, I only realized after posting.
isnt that a duplicate of this issue ?
Module forbidder doesn't leak into test cases if you know what you're doing btw.
This is a really nice kata, but I feel like it could be made even harder! The current reference solution seems quite suboptimal, this can easily be done in
O(n)
.It looks good now; I'll approve.
Also, I don't really expect people to write their tests like I do; it really is something just for me. I'm glad it's understandable, though.
Thanks a lot for the translation and feedback :)
Well, that was pretty fast. Thanks for the translation, though.
Most of it looks good to me; I just think in the test cases it should be
${minN} <= n <= ${maxN}
, rather than${minN} <= |n| <= ${maxN}
, sincen
is always non-negative.Also, this isn't related to your translation, but is the way I write the tests hard to read for others? It's a bit convoluted with the classes and type hints, but it's easier for me since I can reuse most of it from other katas, though I never stopped to wonder if it's making translations harder.
Loading more items...