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 [].
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
a = [0 0 5 10];
b = [3 2 6 6];
c = [3 2 2 6];
assert(isequal(disputed_region(a,b),c))
|
2 | Pass |
%%
a = [0 1 2 3];
b = [-1 2 4 5];
c = [0 2 2 2];
assert(isequal(disputed_region(a,b),c))
|
3 | Pass |
%%
a = [3 4 6 1];
b = [2 1 2 2];
c = [];
assert(isequal(disputed_region(a,b),c))
|
4 | Pass |
%%
a = [5 18 14 6];
b = [11 23 17 18];
c = [11 23 8 1];
assert(isequal(disputed_region(a,b),c))
|
5 | Pass |
%%
a = [100 97 3 2];
b = [99 93 12 12];
c = [100 97 3 2];
assert(isequal(disputed_region(a,b),c))
|
6 | Pass |
%%
delta = 0.5;
a = [0 0 5 10]+delta;
b = [3 2 6 6]+delta;
c = [3 2 2 6]+delta;
assert(isequal(disputed_region(a,b),c))
|
7 | Pass |
%%
a = [0 0 1 1];
b = [2 2 1 1];
c = [];
assert(isequal(disputed_region(a,b),c))
|
415 Solvers
363 Solvers
Project Euler: Problem 3, Largest prime factor
170 Solvers
Project Euler: Problem 5, Smallest multiple
241 Solvers
118 Solvers