Problem 1963. Grid traversal
32.61% Correct | 67.39% Incorrect
Last Solution submitted on Oct 30, 2021
Michael Ryan on 1 Nov 2013
Bug: The order of the arguments in the starting function definition is x1, x2, y1, y2, whereas the the order in the test cases is x1, y1, x2, y2.
Rafael S.T. Vieira on 11 Oct 2020
Technically, this problem is actually requesting the number of unique intersections minus one. For instance in the first case of the test suite, the line crosses the point (5,3) which is shared by four squares, but we count only two, which is the expected behaviour when crossing an edge, but not a vertex: https://imgur.com/a/wCQ6SNG
Solution CommentsShow comments
Problem Recent Solvers24
Given a window, how many subsets of a vector sum positive
More from this Author12
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!