Is Test #3 correct? When I solve it with pencil and paper, I get 15 instead of 14.
[5 4][1 2][2 4][7 5][4 8][4 5][1 6]
= -3 + 0 + 3 + -1 + -4 + -4
= 3+0+3+1+4+4
=15
Have I missed something?
No it's 14. With the ordering, you should get:
[5 4][1 2][2 4][4 8][1 6][4 5][7 5], and the sum is abs(4-1) + abs(2-2) + abs(4-4) + abs(8-1) + abs(6-4) + abs(5-7) = 3 + 0 + 0 + 7 + 2 + 2 = 14
isnt the answer to test 3, 15?
This solution requires Neural Network Toolbox
Maximum running product for a string of numbers
1131 Solvers
1270 Solvers
middleAsColumn: Return all but first and last element as a column vector
394 Solvers
Find the maximum number of decimal places in a set of numbers
769 Solvers
Right Triangle Side Lengths (Inspired by Project Euler Problem 39)
537 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!