Strange, as this passes all of the tests on my box. (How did I pass a random test, and fail the hard coded ones?!?) Maybe a bsxfun issue?
Rounding errors of sqrt. Possible fix circle(3)+10*eps(circle(3)) and r+10*eps(r)
Better, but still not quite there. With those fixes, it passes everything but test 2. I'll try a couple more changes, and then just throw in a hard coded hack for case 2. (Or maybe I'll just ask Tim for his solution. :-)
Another astounding solution by Tim using complex numbers and for loops that create vectors. Example of for loop vectorization: for i=nchoosek(3:6,2)',i,end. Very nice mthod.
Make the vector [1 2 3 4 5 6 7 8 9 10]
Remove all the words that end with "ain"
Clockwise or Counterclockwise
Create logical matrix with a specific row and column sums
Find out missing number from a vector of 9 elements
Rubik's Cube: 30 Moves or Less : Contest Scoring (Time/Size/Moves)
GJam 2013 Veterans: Ocean View (Large)
Genome Sequence 003: DNA Sequence with random positioned segments
Kaggle: Planetoid Game of Life - Solve 3000 of 50000 Puzzles
GJam 2017 Kickstart: Parentheses (Small)
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