Problem 116. Distance walked 2D
Suppose you go from x-y coordinates [3,4] to [0,0] to [0,1] to [1,1], then you walked 7 units of distance.
Solution Stats
Problem Comments
-
2 Comments
Trung Duong
on 8 Feb 2012
better to describe input size: xy 4-by-2, each row is the xy-coordinate of a point
David Young
on 6 Mar 2012
Needs a richer test suite. A lot of "solvers" have just put a=7 as the "solution", but although this satisfies the single test case, it doesn't solve the problem as stated.
Solution Comments
Show commentsProblem Recent Solvers302
Suggested Problems
-
Is my wife right? Now with even more wrong husband
1321 Solvers
-
216 Solvers
-
Find the sum of the elements in the "second" diagonal
1144 Solvers
-
348 Solvers
-
We love vectorized solutions. Problem 1 : remove the row average.
814 Solvers
More from this Author100
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!