Needs more test cases to eliminate the the trivial non-solution that exploits the lack of test cases.
This problem needs more test cases. My solution probably is not general, but it works without using all of its tests.
An interesting test case, for instance, would be (that my solution and many others would fail):
p0 = [1, 0, 0];
p1 = [ -1, 0, 0];
p2 = [ 0, 1, 0.5];
p3 = [ 0, -1, 0.5];
t0 = 0;
t1 = 1;
d = 1;
ok = false;
At half-way their path, asteroid and spacecraft will be at distance 0.5 of each other, violating the safe distance d=1, and without crossing paths.
As you can see from Solution 1310620, the test suite is completely inadequate for this problem.
Number of 1s in a binary string
Return elements unique to either input
Getting the indices from a vector
Convert a Cell Array into an Array
Divisible by 5
Simple spirometer - find your lung capacity from the number and size of soap bubbles in one breath
Basic electricity in a dry situation
Size of this cup?
Sorted highest to lowest?
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