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.
Haskell translation
This comment is hidden because it contains spoiler information about the solution
author had no intention on adding perf constraints on this one (see discussion below)
Approved by someone
Approved by someone
Some solutions show linear time complexity solutions are possible. Do you want to enforce perf constraints on this kata or not?
This one is actually having lowest complexity compared to all better rated solutions!
Of several tested, this was fastest.
agree
Really nice kata and concise, step-by-step description. Thank you!
Shouldn't this kata also enforce performance requirement similar to Squared Spiral#1?
Missing edge cases for horizontal and vertical line segments colinear with one of the rectangular sides with different intersection patterns:
Also missing edge cases where line has zero width:
And edge cases with 0 rectangle area (technically 0 width only and 0 height only should be tested too, but I didn't bother to write tests for those):
The author solution can correctly handle all these test cases without failing or throwing exceptions (due to division by 0). Every submission besides one fails against some of them.
I tried to apply recursion in my solution for generate the coordinates, but it was difficult to make the solution small.
Was quite a good kata !
IMHO not challenging enough in terms of performance..
My sol, not optimized at all, runs in 2,5 secs ??
Funny detail: 'UP' is y+=1 (quite strange for me, I used to be a "graphic" guy thus 'UP' means ... y-=1 to me...:-))
For the maths: is there a closed form ?
I'm getting this error: 8WXSY7WGXBM122383 should be invalid! expected:true but was:false
When I run the code with my IDE I get true.
Loading more items...