Cody

# Problem 391. Poker Series 11: selectBestHand

Solution 1952307

Submitted on 28 Sep 2019
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   Fail
hm1 = [0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; om1 = [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; hm2 = [0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; om2 = [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; out.hm{1} = om1; out.hm{2} = om2; out.winner = 0; assert(isequal(selectBestHand(hm1,hm2),out))

X = 1×2 cell array {1×1 struct} {1×1 struct} X = 1×2 cell array {1×1 struct} {1×1 struct} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} winner: [0×1 double]

Assertion failed.

2   Fail
hm1 = [0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; om1 = [0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; hm2 = [0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; om2 = [0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; out.hm{1} = om1; out.hm{2} = om2; out.winner = 2; assert(isequal(selectBestHand(hm1,hm2),out))

prese = 1 2 prese = 3 prese = 1 2 out = struct with fields: flag: 1 out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] dop = 1×13 logical array 0 1 0 0 0 0 0 0 0 0 0 0 1 sc1 = logical 0 O = 1×9 cell array {0×0 double} {0×0 double} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} prese = 1 prese = 3 prese = 1 2 3 out = struct with fields: flag: 1 out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] dop = 1×13 logical array 0 1 0 0 0 0 0 0 0 0 0 0 0 sc1 = logical 0 O = 1×9 cell array {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} winner: 1

Assertion failed.

3   Fail
hm1 = [0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0]; om1 = [0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0]; hm2 = [0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0]; om2 = [0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; out.hm{1} = om1; out.hm{2} = om2; out.winner = 1; assert(isequal(selectBestHand(hm1,hm2),out))

prese = 1 2 prese = 3 prese = 1 2 out = struct with fields: flag: 1 out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] dop = 1×13 logical array 0 1 0 0 0 0 0 0 0 0 0 0 1 sc1 = logical 0 out = struct with fields: flag: 1 usedCards: [4×13 logical] O = 1×9 cell array {0×0 double} {0×0 double} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} rest = 4 13 out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} prese = 1 2 prese = 3 prese = 4 prese = 1 out = struct with fields: flag: 1 out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] dop = 1×13 logical array 0 1 0 0 0 0 0 0 0 0 0 0 1 sc1 = logical 0 out = struct with fields: flag: 1 usedCards: [4×13 logical] O = 1×9 cell array {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} winner: 2

Assertion failed.

4   Pass
hm1 = [0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0]; om1 = [0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0]; hm2 = [0 1 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0]; om2 = [0 1 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0]; out.hm{1} = om1; out.hm{2} = om2; out.winner = 1; assert(isequal(selectBestHand(hm1,hm2),out))

prese = 1 2 prese = 3 prese = 1 2 out = struct with fields: flag: 1 out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] dop = 1×13 logical array 0 1 0 0 0 0 0 0 0 0 0 0 1 sc1 = logical 0 out = struct with fields: flag: 1 usedCards: [4×13 logical] O = 1×9 cell array {0×0 double} {0×0 double} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} rest = 4 13 out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} prese = 1 prese = 1 2 3 4 out = struct with fields: flag: 1 out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] dop = 1×13 logical array 0 1 0 0 0 0 0 0 0 0 0 0 0 sc1 = logical 0 O = 1×9 cell array {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} rest = 12 out = struct with fields: hm: {[4×13 logical] [4×13 logical]} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} X = 1×2 cell array {1×1 struct} {1×1 struct} X = 1×2 cell array {1×1 struct} {1×1 struct} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} winner: 1

5   Fail
hm1 = [0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0]; om1 = [0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0]; hm2 = [0 1 0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0]; om2 = [0 1 0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; out.hm{1} = om1; out.hm{2} = om2; out.winner = 1; assert(isequal(selectBestHand(hm1,hm2),out))

prese = 1 2 prese = 4 prese = 3 prese = 3 out = struct with fields: flag: 1 out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] dop = 1×13 logical array 0 1 0 0 0 0 0 0 0 0 0 0 1 sc1 = logical 0 O = 1×9 cell array {0×0 double} {0×0 double} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} prese = 1 prese = 1 2 prese = 3 prese = 4 out = struct with fields: flag: 1 out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] dop = 1×13 logical array 0 1 0 0 0 0 0 0 0 0 0 1 0 sc1 = logical 0 O = 1×9 cell array {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} X = 1×2 cell array {1×1 struct} {1×1 struct} X = 1×2 cell array {1×1 struct} {1×1 struct} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} winner: 0

Assertion failed.

6   Fail
hm1 = [1 1 1 1 1 0 0 0 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0]; om1 = [1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; hm2 = [0 1 0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0]; om2 = [0 1 0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; out.hm{1} = om1; out.hm{2} = om2; out.winner = 1; assert(isequal(selectBestHand(hm1,hm2),out))

prese = 1 prese = 1 2 prese = 4 prese = 3 out = struct with fields: flag: 1 out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] dop = 1×13 logical array 0 1 0 1 1 0 0 0 0 0 0 0 1 sc1 = logical 0 O = 1×9 cell array {0×0 double} {0×0 double} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} prese = 1 prese = 1 2 prese = 3 prese = 4 out = struct with fields: flag: 1 out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] dop = 1×13 logical array 0 1 0 0 0 0 0 0 0 0 0 1 0 sc1 = logical 0 O = 1×9 cell array {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} winner: 2

Assertion failed.

7   Pass
hm1 = [1 1 1 1 1 0 0 0 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0]; om1 = [1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; hm2 = [1 1 1 1 1 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0]; om2 = [0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; out.hm{1} = om1; out.hm{2} = om2; out.winner = 2; assert(isequal(selectBestHand(hm1,hm2),out))

prese = 1 prese = 1 2 prese = 4 prese = 3 out = struct with fields: flag: 1 out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] dop = 1×13 logical array 0 1 0 1 1 0 0 0 0 0 0 0 1 sc1 = logical 0 O = 1×9 cell array {0×0 double} {0×0 double} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} prese = 1 prese = 1 prese = 1 2 prese = 3 out = struct with fields: flag: 1 out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] dop = 1×13 logical array 0 0 0 0 1 0 0 0 0 0 0 1 0 sc1 = logical 0 O = 1×9 cell array {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} X = 1×2 cell array {1×1 struct} {1×1 struct} X = 1×2 cell array {1×1 struct} {1×1 struct} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} winner: 2

8   Fail
hm1 = [0 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; om1 = [0 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; hm2 = [0 0 0 0 1 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0]; om2 = [0 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0]; out.hm{1} = om1; out.hm{2} = om2; out.winner = 2; assert(isequal(selectBestHand(hm1,hm2),out))

prese = 2 prese = 3 prese = 1 prese = 3 prese = 1 out = struct with fields: flag: 1 out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] dop = 1×13 logical array 0 1 0 0 0 0 0 0 0 0 0 0 0 sc1 = logical 0 O = 1×9 cell array {0×0 double} {0×0 double} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} prese = 1 prese = 1 prese = 3 prese = 1 prese = 1 out = struct with fields: flag: 1 out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] dop = 1×13 logical array 0 0 0 0 1 0 0 0 0 0 0 0 0 sc1 = logical 0 O = 1×9 cell array {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} X = 1×2 cell array {1×1 struct} {1×1 struct} X = 1×2 cell array {1×1 struct} {1×1 struct} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} winner: 0

Assertion failed.

9   Fail
hm1 = [0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0]; om1 = [0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0]; hm2 = [0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0]; om2 = [0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; out.hm{1} = om1; out.hm{2} = om2; out.winner = 2; assert(isequal(selectBestHand(hm1,hm2),out))

prese = 1 2 prese = 4 prese = 3 prese = 3 out = struct with fields: flag: 1 out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] dop = 1×13 logical array 0 1 0 0 0 0 0 0 0 0 0 0 1 sc1 = logical 0 O = 1×9 cell array {0×0 double} {0×0 double} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} out = struct with fields: hm: {[4×13 logical] [4×13 double]} prese = 1 2 prese = 3 prese = 3 prese = 4 out = struct with fields: flag: 1 out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] out = struct with fields: flag: 1 usedCards: [4×13 logical] dop = 1×13 logical array 0 1 0 0 0 0 0 0 0 0 0 0 1 sc1 = logical 0 O = 1×9 cell array {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} {1×1 struct} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} X = 1×2 cell array {1×1 struct} {1×1 struct} X = 1×2 cell array {1×1 struct} {1×1 struct} out = struct with fields: hm: {[4×13 logical] [4×13 logical]} winner: 0

Assertion failed.