Problem 2318. Combine Cards to make 21
Solution Stats
Problem Comments
-
4 Comments
nice problem!, consider perhaps adding 'AAA' (with solutions {'+-','-+'}) to the testsuite to make it more challenging
Thanks for the suggestion Alfonso. That does make things a little more challenging. :)
Did you have fun this this last test case, isn't it?? XDDD
YOU... BAD GUYS!! ;-)
J,Q, and K all have value 10. This rule should be probably added to the problem description.
Solution Comments
-
1 Comment
soft
-
1 Comment
trash
-
2 Comments
Probably I don't understand what problem ask, but...I think test suite is wrong. For example: test suite 2.
cards = 'A23QJK';
mathSymbols = {'+-/++'};
1+2=3-3=0/9=0+8=8+10=18 that is not 21!
I found {'+-+-+','+/*--','-+-++','-*/++'}=21.
I've problem even in test 5
'A' can take the value 1 or 11 (e.g. 'AAA' with symbols '+-' means 11+11-1==21). 'JQK' all count as 10 (e.g. 'A23QJK' with symbols '+-/++' means ((11+2)-3)/10+10+10==21)
Problem Recent Solvers35
Suggested Problems
-
5588 Solvers
-
The Goldbach Conjecture, Part 2
1911 Solvers
-
4015 Solvers
-
Check to see if a Sudoku Puzzle is Solved
307 Solvers
-
527 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!