Problem 1074. Property dispute!
Two neighbors have rectangular plots of land A and B. The surveyors give you the coordinates of each. If they overlap, there is a property dispute, and you must return the coordinates of the disputed region. If there is no conflict, return the empty set [].
Suppose A and B look like this.
*--------* | A | | *--------* | | | | | | | B | | | | | | *--------* | | *--------*
We will give rectangle coordinates in [xLow yLow width height] format. So
A = [0 0 5 10] B = [3 2 6 6]
Then you should return rectangle that corresponds to the overlapping region.
C = [3 2 2 6]
Solution Stats
Problem Comments
-
1 Comment
I fixed the test suite, which had a problem described by Alfonso below.
Solution Comments
Show commentsProblem Recent Solvers32
Suggested Problems
-
Return the largest number that is adjacent to a zero
5131 Solvers
-
1590 Solvers
-
Determine if input is a perfect number
215 Solvers
-
8758 Solvers
-
There are 10 types of people in the world
978 Solvers
More from this Author50
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!