Cody

# Problem 329. Poker Series 01: isStraightFlush

Solution 1837596

Submitted on 4 Jun 2019 by YIFEI ZHANG
• Size: 7
• This is the leading solution.
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
hm = [0 0 0 0 0 0 0 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]; y_correct.flag = true; y_correct.usedCards = logical([0 0 0 0 0 0 0 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]) assert(isequal(isStraightFlush(hm),y_correct))

y_correct = struct with fields: flag: 1 usedCards: [4×13 logical] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In isStraightFlush (line 2) In ScoringEngineTestPoint1 (line 11) In solutionTest (line 3)]

2   Pass
hm = [0 0 0 0 0 0 0 0 1 1 0 1 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 0 0]; y_correct.flag = false; y_correct.usedCards = logical([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]) assert(isequal(isStraightFlush(hm),y_correct))

y_correct = struct with fields: flag: 0 usedCards: [4×13 logical] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In isStraightFlush (line 2) In ScoringEngineTestPoint2 (line 11) In solutionTest (line 5)]

3   Pass
hm = [0 0 0 0 0 0 0 0 1 1 0 1 1 1 0 0 0 0 0 0 0 0 1 1 1 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]; y_correct.flag = true; y_correct.usedCards = logical([0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 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]) assert(isequal(isStraightFlush(hm),y_correct)) hm = [0 0 0 0 0 0 0 0 1 1 0 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0]; y_correct.flag = true; y_correct.usedCards = logical([0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 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]) assert(isequal(isStraightFlush(hm),y_correct))

y_correct = struct with fields: flag: 1 usedCards: [4×13 logical] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In isStraightFlush (line 2) In ScoringEngineTestPoint3 (line 11) In solutionTest (line 7)] y_correct = struct with fields: flag: 1 usedCards: [4×13 logical] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In isStraightFlush (line 2) In ScoringEngineTestPoint3 (line 23) In solutionTest (line 7)]