Cody

Solution 2402891

Submitted on 28 May 2020 by Nikolaos Nikolaou
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
cards = 'A3762'; mathSymbols = {'+-*/'}; assert(isequal(sort(solveBlackjackPuzzle(cards)), sort(mathSymbols)))

t = 1 2 3 4 C = 1×1 cell array {'+-*/'}

2   Pass
cards = 'A23QJK'; mathSymbols = {'+-/++'}; assert(isequal(sort(solveBlackjackPuzzle(cards)), sort(mathSymbols)))

t = 1 2 4 1 1 C = 1×1 cell array {'+-/++'}

3   Pass
cards = '923'; mathSymbols = {'*+', '-*'}; assert(isequal(sort(solveBlackjackPuzzle(cards)), sort(mathSymbols)))

t = 2 3 C = 1×1 cell array {'-*'} t = 3 1 C = 1×2 cell array {'-*'} {'*+'}

4   Pass
cards = 'A23456'; mathSymbols = {'**+++', '*+*-+', '*-+*+', '+++++', '+++-+', '-+/*+', '--+++', '/-*++', '/--+*'}; assert(isequal(sort(solveBlackjackPuzzle(cards)), sort(mathSymbols)))

t = 1 1 1 1 1 C = 1×1 cell array {'+++++'} t = 1 1 1 2 1 C = 1×2 cell array {'+++++'} {'+++-+'} t = 2 1 4 3 1 C = 1×3 cell array {'+++++'} {'+++-+'} {'-+/*+'} t = 2 2 1 1 1 C = 1×4 cell array {'+++++'} {'+++-+'} {'-+/*+'} {'--+++'} t = 3 1 3 2 1 C = 1×5 cell array {'+++++'} {'+++-+'} {'-+/*+'} {'--+++'} {'*+*-+'} t = 3 2 1 3 1 C = 1×6 cell array {'+++++'} {'+++-+'} {'-+/*+'} {'--+++'} {'*+*-+'} {'*-+*+'} t = 3 3 1 1 1 C = 1×7 cell array {'+++++'} {'+++-+'} {'-+/*+'} {'--+++'} {'*+*-+'} {'*-+*+'} {'**+++'} t = 4 2 2 1 3 C = 1×8 cell array {'+++++'} {'+++-+'} {'-+/*+'} {'--+++'} {'*+*-+'} {'*-+*+'} {'**+++'} {'/--+*'} t = 4 2 3 1 1 C = 1×9 cell array {'+++++'} {'+++-+'} {'-+/*+'} {'--+++'} {'*+*-+'} {'*-+*+'} {'**+++'} {'/--+*'} {'/-*++'}

5   Pass
cards = 'JQKA'; mathSymbols = {'*/+', '+-+', '-++', '/*+'}; assert(isequal(sort(solveBlackjackPuzzle(cards)), sort(mathSymbols)))

t = 1 2 1 C = 1×1 cell array {'+-+'} t = 2 1 1 C = 1×2 cell array {'+-+'} {'-++'} t = 3 4 1 C = 1×3 cell array {'+-+'} {'-++'} {'*/+'} t = 4 3 1 C = 1×4 cell array {'+-+'} {'-++'} {'*/+'} {'/*+'}

6   Pass
cards = 'KA'; mathSymbols = {'+'}; assert(isequal(sort(solveBlackjackPuzzle(cards)), sort(mathSymbols)))

t = 1 C = 1×1 cell array {'+'}

7   Pass
cards = 'AAA'; mathSymbols = {'+-','-+'}; assert(isequal(sort(solveBlackjackPuzzle(cards)), sort(mathSymbols)))