6 kyu
Maximum Possible Amount of Lattice Points That May Be Encountered By a Single Laser Beam.
Loading description...
Fundamentals
Data Structures
Algorithms
Mathematics
Logic
Geometry
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Mixed return types should be avoided.
Why is the special case even needed? Perfectly valid answer can be formed when there are no three co linear points, doesn't it?
I removed the special case.
The new reference solution fails at
[(-1, 0), (1, 0), (0, 0)]
.Fixed, and added it to the fixed test cases
Hi raul,
It seems you forgot this kata for a while (and same for this one). Will you be able to solve their issues in the next few days? (...weeks? ...months?? ;) ) I would like to do them both. ;)
Cheers,
B4B
Unfortunately, it's taking years and is approaching decades ;-)
.
Running the test suite, I get 'The set does not even have 3 aligned points' should equal [2, 1]
This expected result does not fit with the Kata description:
In the case that we cannot find a laser beam with at least 3 encountered lattice points the function will return "The set does not even have 3 aligned points"
Have I misunderstood something?
There's a bug in the original reference solution. I've now replaced it with my own (most definitely not bugged ;-)) solution.
This comment has been hidden.
You're right. It's due to a precision issue in my code. I'll fix it using the fraction module for the slope and independent term for each beam.
Replaced with my own (most definitely not bugged ;-)) solution.
You reference implementation seems to be wrong. Try
[(0, 0), (1, 0), (2, 0), (0, 1), (1, 1), (2, 1)]
.This comment has been hidden.
This comment has been hidden.
There's a missing parenthesss in the example test cases:
Also, I believe that two adjacent string literals are considered a better style than line continuation.
Fixed the the missing parenthessis in the example test cases. Thanks
Can there be equal points? If so, it should be tested more thoroughly since it's a tricky case for many possible solutions.
This comment has been hidden.