Find a short way through given points. This is the travelling salesman problem. But the solution should be a fast and small function.
Have fun!
Solution Stats
Problem Comments
6 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers136
Suggested Problems
-
Getting the absolute index from a matrix
254 Solvers
-
Remove the two elements next to NaN value
703 Solvers
-
Right Triangle Side Lengths (Inspired by Project Euler Problem 39)
2037 Solvers
-
295 Solvers
-
Celsius to Fahrenheit converter
666 Solvers
More from this Author3
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
This problem needs an update due to changes in scoring system in Cody
You need to specify the comparison method when sorting complex numbers. Any change done to the order of elements currently creates an invalid solution (even sorting elements), and I guess the one that you want is 'real'. Or don't use complex numbers and create pair of values [x,y]. I've commented my solution. Futhermore, the function calculateSize no longer exists.
Would someone please fix the test? The function calculateSize does not exist.
The test suite has been fixed, Chris. You can now attempt the question.
Thanks Dyuman
I overthought this problem for so long until I noticed the special pattern in the test case. That’s when I realized there’s such a short and elegant solution, haha. Really fun and tricky one!