Problem 470. Scoring for oriented dominoes
Solution Stats
Problem Comments
-
3 Comments
CAM
on 7 Feb 2014
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?
Raymond Phan
on 26 Jul 2014
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
Zhiyuan Lang
on 3 May 2022
good
Solution Comments
-
1 Comment
Samantha Cruz
on 14 Jul 2021
yeah
-
1 Comment
Jack BLAIR
on 27 Mar 2014
isnt the answer to test 3, 15?
-
1 Comment
Aurelien Queffurust
on 11 Apr 2012
This solution requires Neural Network Toolbox
Problem Recent Solvers696
Suggested Problems
-
Reverse the Words (not letters) of a String
408 Solvers
-
470 Solvers
-
552 Solvers
-
436 Solvers
-
Find out sum and carry of Binary adder
1003 Solvers
More from this Author51
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!