I fixed the test suite, which had a problem described by Alfonso below.
I believe in test set 3 c should be empty?
In test 3, A is wholly contained within B. But I added another test case that should return the empty set .
Perhaps you are referring to test 5, in test 3 a box with width/height [6,1] is hardly contained in a box with width/height [2,2]... or perhaps i am misinterpreting?
Most previous solutions returned [0 0 0 0] for no intersection since that is what the test suite seemed to want.
My apologies. I don't know why I had this wrong before, but according to my description, yes, test 3 should return .
why are results of test 3 and 7 not consistent ? is it possible to fix it ? by the way, [0 0 0 0] was easier to get...
This only works for integer coordinates.
I added a test with non-integer inputs.
Make the vector [1 2 3 4 5 6 7 8 9 10]
Find the maximum number of decimal places in a set of numbers
Getting the indices from a matrice
Return a list sorted by number of consecutive occurrences
Dots in a Sphere
Repopulate the City
Rotate and display numbered tile
The 17x17 Problem
Encoding Google Maps Polylines
Put two time series onto the same time basis
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office