Property dispute! - MATLAB Cody - MATLAB Central

Problem 1074. Property dispute!

Difficulty:Rate
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

43.44% Correct | 56.56% Incorrect
Last Solution submitted on Dec 14, 2024

Problem Comments

Solution Comments

Show comments
R2025a Pre-release highlights
This topic is for discussing highlights to the current R2025a Pre-release.
14
6

Problem Recent Solvers39

Suggested Problems

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!
Go to top of page