Cody

# Problem 534. Find best domino orientation

Solution 438953

Submitted on 6 May 2014 by Axel
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
%% list = [5 2 3 7 4 9 2 3 8 2 3 5 8 2 7 8 4 2 8 2]; y_correct = [0 0 1 1 1 1 1 1 0 1]; assert(isequal(findBestDominoeOrientation(list),y_correct))

m = 1.0000e+09 s = 35 ans = 0 0 0 0 0 0 0 0 0 0 m = 35 s = 29 ans = 0 0 0 0 0 0 0 0 0 1 m = 29 s = 35 s = 33 s = 35 s = 29 s = 35 s = 33 s = 31 s = 25 ans = 0 0 0 0 0 0 1 0 0 1 m = 25 s = 31 s = 29 s = 29 s = 23 ans = 0 0 0 0 0 0 1 1 0 1 m = 23 s = 29 s = 27 s = 39 s = 33 s = 39 s = 37 s = 39 s = 33 s = 39 s = 37 s = 31 s = 25 s = 31 s = 29 s = 29 s = 23 s = 29 s = 27 s = 35 s = 29 s = 35 s = 33 s = 35 s = 29 s = 35 s = 33 s = 31 s = 25 s = 31 s = 29 s = 29 s = 23 s = 29 s = 27 s = 35 s = 29 s = 35 s = 33 s = 35 s = 29 s = 35 s = 33 s = 27 s = 21 ans = 0 0 0 0 1 1 1 0 0 1 m = 21 s = 27 s = 25 s = 25 s = 19 ans = 0 0 0 0 1 1 1 1 0 1 m = 19 s = 25 s = 23 s = 35 s = 29 s = 35 s = 33 s = 35 s = 29 s = 35 s = 33 s = 31 s = 25 s = 31 s = 29 s = 29 s = 23 s = 29 s = 27 s = 39 s = 33 s = 39 s = 37 s = 39 s = 33 s = 39 s = 37 s = 31 s = 25 s = 31 s = 29 s = 29 s = 23 s = 29 s = 27 s = 33 s = 27 s = 33 s = 31 s = 33 s = 27 s = 33 s = 31 s = 29 s = 23 s = 29 s = 27 s = 27 s = 21 s = 27 s = 25 s = 33 s = 27 s = 33 s = 31 s = 33 s = 27 s = 33 s = 31 s = 25 s = 19 s = 25 s = 23 s = 23 s = 17 ans = 0 0 0 1 1 1 1 1 0 1 m = 17 s = 23 s = 21 s = 29 s = 23 s = 29 s = 27 s = 29 s = 23 s = 29 s = 27 s = 25 s = 19 s = 25 s = 23 s = 23 s = 17 s = 23 s = 21 s = 33 s = 27 s = 33 s = 31 s = 33 s = 27 s = 33 s = 31 s = 25 s = 19 s = 25 s = 23 s = 23 s = 17 s = 23 s = 21 s = 29 s = 23 s = 29 s = 27 s = 29 s = 23 s = 29 s = 27 s = 25 s = 19 s = 25 s = 23 s = 23 s = 17 s = 23 s = 21 s = 29 s = 23 s = 29 s = 27 s = 29 s = 23 s = 29 s = 27 s = 21 s = 15 ans = 0 0 1 0 1 1 1 0 0 1 m = 15 s = 21 s = 19 s = 19 s = 13 ans = 0 0 1 0 1 1 1 1 0 1 m = 13 s = 19 s = 17 s = 29 s = 23 s = 29 s = 27 s = 29 s = 23 s = 29 s = 27 s = 25 s = 19 s = 25 s = 23 s = 23 s = 17 s = 23 s = 21 s = 33 s = 27 s = 33 s = 31 s = 33 s = 27 s = 33 s = 31 s = 25 s = 19 s = 25 s = 23 s = 23 s = 17 s = 23 s = 21 s = 27 s = 21 s = 27 s = 25 s = 27 s = 21 s = 27 s = 25 s = 23 s = 17 s = 23 s = 21 s = 21 s = 15 s = 21 s = 19 s = 27 s = 21 s = 27 s = 25 s = 27 s = 21 s = 27 s = 25 s = 19 s = 13 s = 19 s = 17 s = 17 s = 11 ans = 0 0 1 1 1 1 1 1 0 1 m = 11 s = 17 s = 15 s = 37 s = 31 s = 37 s = 35 s = 37 s = 31 s = 37 s = 35 s = 33 s = 27 s = 33 s = 31 s = 31 s = 25 s = 31 s = 29 s = 41 s = 35 s = 41 s = 39 s = 41 s = 35 s = 41 s = 39 s = 33 s = 27 s = 33 s = 31 s = 31 s = 25 s = 31 s = 29 s = 37 s = 31 s = 37 s = 35 s = 37 s = 31 s = 37 s = 35 s = 33 s = 27 s = 33 s = 31 s = 31 s = 25 s = 31 s = 29 s = 37 s = 31 s = 37 s = 35 s = 37 s = 31 s = 37 s = 35 s = 29 s = 23 s = 29 s = 27 s = 27 s = 21 s = 27 s = 25 s = 37 s = 31 s = 37 s = 35 s = 37 s = 31 s = 37 s = 35 s = 33 s = 27 s = 33 s = 31 s = 31 s = 25 s = 31 s = 29 s = 41 s = 35 s = 41 s = 39 s = 41 s = 35 s = 41 s = 39 s = 33 s = 27 s = 33 s = 31 s = 31 s = 25 s = 31 s = 29 s = 35 s = 29 s = 35 s = 33 s = 35 s = 29 s = 35 s = 33 s = 31 s = 25 s = 31 s = 29 s = 29 s = 23 s = 29 s = 27 s = 35 s = 29 s = 35 s = 33 s = 35 s = 29 s = 35 s = 33 s = 27 s = 21 s = 27 s = 25 s = 25 s = 19 s = 25 s = 23 s = 37 s = 31 s = 37 s = 35 s = 37 s = 31 s = 37 s = 35 s = 33 s = 27 s = 33 s = 31 s = 31 s = 25 s = 31 s = 29 s = 41 s = 35 s = 41 s = 39 s = 41 s = 35 s = 41 s = 39 s = 33 s = 27 s = 33 s = 31 s = 31 s = 25 s = 31 s = 29 s = 37 s = 31 s = 37 s = 35 s = 37 s = 31 s = 37 s = 35 s = 33 s = 27 s = 33 s = 31 s = 31 s = 25 s = 31 s = 29 s = 37 s = 31 s = 37 s = 35 s = 37 s = 31 s = 37 s = 35 s = 29 s = 23 s = 29 s = 27 s = 27 s = 21 s = 27 s = 25 s = 37 s = 31 s = 37 s = 35 s = 37 s = 31 s = 37 s = 35 s = 33 s = 27 s = 33 s = 31 s = 31 s = 25 s = 31 s = 29 s = 41 s = 35 s = 41 s = 39 s = 41 s = 35 s = 41 s = 39 s = 33 s = 27 s = 33 s = 31 s = 31 s = 25 s = 31 s = 29 s = 35 s = 29 s = 35 s = 33 s = 35 s = 29 s = 35 s = 33 s = 31 s = 25 s = 31 s = 29 s = 29 s = 23 s = 29 s = 27 s = 35 s = 29 s = 35 s = 33 s = 35 s = 29 s = 35 s = 33 s = 27 s = 21 s = 27 s = 25 s = 25 s = 19 s = 25 s = 23 s = 36 s = 30 s = 36 s = 34 s = 36 s = 30 s = 36 s = 34 s = 32 s = 26 s = 32 s = 30 s = 30 s = 24 s = 30 s = 28 s = 40 s = 34 s = 40 s = 38 s = 40 s = 34 s = 40 s = 38 s = 32 s = 26 s = 32 s = 30 s = 30 s = 24 s = 30 s = 28 s = 36 s = 30 s = 36 s = 34 s = 36 s = 30 s = 36 s = 34 s = 32 s = 26 s = 32 s = 30 s = 30 s = 24 s = 30 s = 28 s = 36 s = 30 s = 36 s = 34 s = 36 s = 30 s = 36 s = 34 s = 28 s = 22 s = 28 s = 26 s = 26 s = 20 s = 26 s = 24 s = 36 s = 30 s = 36 s = 34 s = 36 s = 30 s = 36 s = 34 s = 32 s = 26 s = 32 s = 30 s = 30 s = 24 s = 30 s = 28 s = 40 s = 34 s = 40 s = 38 s = 40 s = 34 s = 40 s = 38 s = 32 s = 26 s = 32 s = 30 s = 30 s = 24 s = 30 s = 28 s = 34 s = 28 s = 34 s = 32 s = 34 s = 28 s = 34 s = 32 s = 30 s = 24 s = 30 s = 28 s = 28 s = 22 s = 28 s = 26 s = 34 s = 28 s = 34 s = 32 s = 34 s = 28 s = 34 s = 32 s = 26 s = 20 s = 26 s = 24 s = 24 s = 18 s = 24 s = 22 s = 30 s = 24 s = 30 s = 28 s = 30 s = 24 s = 30 s = 28 s = 26 s = 20 s = 26 s = 24 s = 24 s = 18 s = 24 s = 22 s = 34 s = 28 s = 34 s = 32 s = 34 s = 28 s = 34 s = 32 s = 26 s = 20 s = 26 s = 24 s = 24 s = 18 s = 24 s = 22 s = 30 s = 24 s = 30 s = 28 s = 30 s = 24 s = 30 s = 28 s = 26 s = 20 s = 26 s = 24 s = 24 s = 18 s = 24 s = 22 s = 30 s = 24 s = 30 s = 28 s = 30 s = 24 s = 30 s = 28 s = 22 s = 16 s = 22 s = 20 s = 20 s = 14 s = 20 s = 18 s = 30 s = 24 s = 30 s = 28 s = 30 s = 24 s = 30 s = 28 s = 26 s = 20 s = 26 s = 24 s = 24 s = 18 s = 24 s = 22 s = 34 s = 28 s = 34 s = 32 s = 34 s = 28 s = 34 s = 32 s = 26 s = 20 s = 26 s = 24 s = 24 s = 18 s = 24 s = 22 s = 28 s = 22 s = 28 s = 26 s = 28 s = 22 s = 28 s = 26 s = 24 s = 18 s = 24 s = 22 s = 22 s = 16 s = 22 s = 20 s = 28 s = 22 s = 28 s = 26 s = 28 s = 22 s = 28 s = 26 s = 20 s = 14 s = 20 s = 18 s = 18 s = 12 s = 18 s = 16 s = 34 s = 28 s = 34 s = 32 s = 34 s = 28 s = 34 s = 32 s = 30 s = 24 s = 30 s = 28 s = 28 s = 22 s = 28 s = 26 s = 38 s = 32 s = 38 s = 36 s = 38 s = 32 s = 38 s = 36 s = 30 s = 24 s = 30 s = 28 s = 28 s = 22 s = 28 s = 26 s = 34 s = 28 s = 34 s = 32 s = 34 s = 28 s = 34 s = 32 s = 30 s = 24 s = 30 s = 28 s = 28 s = 22 s = 28 s = 26 s = 34 s = 28 s = 34 s = 32 s = 34 s = 28 s = 34 s = 32 s = 26 s = 20 s = 26 s = 24 s = 24 s = 18 s = 24 s = 22 s = 34 s = 28 s = 34 s = 32 s = ...

2   Fail
%% list = [0 8 4 8 2 0 8 0 5 7 7 2 1 6 2 6 2 7 0 2]; y_correct = [0 1 0 1 1 1 1 0 1 1]; assert(isequal(findBestDominoeOrientation(list),y_correct))

m = 1.0000e+09 s = 39 ans = 0 0 0 0 0 0 0 0 0 0 m = 39 s = 37 ans = 0 0 0 0 0 0 0 0 0 1 m = 37 s = 31 ans = 0 0 0 0 0 0 0 0 1 0 m = 31 s = 29 ans = 0 0 0 0 0 0 0 0 1 1 m = 29 s = 31 s = 29 s = 31 s = 29 s = 39 s = 37 s = 31 s = 29 s = 39 s = 37 s = 39 s = 37 s = 49 s = 47 s = 41 s = 39 s = 41 s = 39 s = 41 s = 39 s = 41 s = 39 s = 33 s = 31 s = 41 s = 39 s = 41 s = 39 s = 43 s = 41 s = 35 s = 33 s = 35 s = 33 s = 35 s = 33 s = 43 s = 41 s = 35 s = 33 s = 43 s = 41 s = 43 s = 41 s = 49 s = 47 s = 41 s = 39 s = 41 s = 39 s = 41 s = 39 s = 41 s = 39 s = 33 s = 31 s = 41 s = 39 s = 41 s = 39 s = 29 s = 27 ans = 0 0 0 1 0 0 0 0 0 1 m = 27 s = 21 ans = 0 0 0 1 0 0 0 0 1 0 m = 21 s = 19 ans = 0 0 0 1 0 0 0 0 1 1 m = 19 s = 21 s = 19 s = 21 s = 19 s = 29 s = 27 s = 21 s = 19 s = 29 s = 27 s = 29 s = 27 s = 39 s = 37 s = 31 s = 29 s = 31 s = 29 s = 31 s = 29 s = 31 s = 29 s = 23 s = 21 s = 31 s = 29 s = 31 s = 29 s = 29 s = 27 s = 21 s = 19 s = 21 s = 19 s = 21 s = 19 s = 29 s = 27 s = 21 s = 19 s = 29 s = 27 s = 29 s = 27 s = 35 s = 33 s = 27 s = 25 s = 27 s = 25 s = 27 s = 25 s = 27 s = 25 s = 19 s = 17 ans = 0 0 0 1 1 1 1 0 1 1 m = 17 s = 27 s = 25 s = 27 s = 25 s = 39 s = 37 s = 31 s = 29 s = 31 s = 29 s = 31 s = 29 s = 39 s = 37 s = 31 s = 29 s = 39 s = 37 s = 39 s = 37 s = 49 s = 47 s = 41 s = 39 s = 41 s = 39 s = 41 s = 39 s = 41 s = 39 s = 33 s = 31 s = 41 s = 39 s = 41 s = 39 s = 43 s = 41 s = 35 s = 33 s = 35 s = 33 s = 35 s = 33 s = 43 s = 41 s = 35 s = 33 s = 43 s = 41 s = 43 s = 41 s = 49 s = 47 s = 41 s = 39 s = 41 s = 39 s = 41 s = 39 s = 41 s = 39 s = 33 s = 31 s = 41 s = 39 s = 41 s = 39 s = 33 s = 31 s = 25 s = 23 s = 25 s = 23 s = 25 s = 23 s = 33 s = 31 s = 25 s = 23 s = 33 s = 31 s = 33 s = 31 s = 43 s = 41 s = 35 s = 33 s = 35 s = 33 s = 35 s = 33 s = 35 s = 33 s = 27 s = 25 s = 35 s = 33 s = 35 s = 33 s = 33 s = 31 s = 25 s = 23 s = 25 s = 23 s = 25 s = 23 s = 33 s = 31 s = 25 s = 23 s = 33 s = 31 s = 33 s = 31 s = 39 s = 37 s = 31 s = 29 s = 31 s = 29 s = 31 s = 29 s = 31 s = 29 s = 23 s = 21 s = 31 s = 29 s = 31 s = 29 s = 31 s = 29 s = 23 s = 21 s = 23 s = 21 s = 23 s = 21 s = 31 s = 29 s = 23 s = 21 s = 31 s = 29 s = 31 s = 29 s = 41 s = 39 s = 33 s = 31 s = 33 s = 31 s = 33 s = 31 s = 33 s = 31 s = 25 s = 23 s = 33 s = 31 s = 33 s = 31 s = 35 s = 33 s

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!