MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Todaysuppose you go from x-y-z coordinates [3,4,2] to [0,0,2] to [0,1,2] to [1,1,2], to [1,1,20] then you walked 25 units of distance. If input xyz =[3 4 2; 0 0 2; 0 1 2; 1 1 2; 1 1 20] then output w=25.

154 correct solutions
70 incorrect solutions

Last solution submitted on Dec 13, 2014

1 player likes this problem

2 Comments

Michael
on 27 Jan 2012

Brilliant!

dangee
on 23 Jul 2012

Can you explain the problem. Walking from [3 4 2] to [0 0 2] gives (3-0)+(4-0) = 7 units. Then from [0 0 2] to [0 1 2] gives 1 unit. From [0 1 2] to [1 1 2] gives 1 unit and finally from [1 1 2] to [1 1 20] gives 18 units. So sum of distance is 7+1+1+18 = 27. Is it right?

2 Comments