Cody

# Problem 56. Scrabble Scores

Solution 1425392

Submitted on 26 Jan 2018 by Toolman Thoolen
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
str = 'a'; score = 1; assert(isequal(scrabble_score(str),score))

str = ' 1' str = ' 1' str = ' 1' str = ' 1' str = ' 1' str = ' 1' str = ' 1'

2   Pass
str = 'matlab'; score = 10; assert(isequal(scrabble_score(str),score))

str = 'm 1 1 1 1b' str = 'm 1 1 1 1b' str = ' 3 1 1 1 1 3' str = ' 3 1 1 1 1 3' str = ' 3 1 1 1 1 3' str = ' 3 1 1 1 1 3' str = ' 3 1 1 1 1 3'

3   Pass
str = 'quetzalcoatl'; score = 32; assert(isequal(scrabble_score(str),score))

str = 'q 1 1 1z 1 1c 1 1 1 1' str = 'q 1 1 1z 1 1c 1 1 1 1' str = 'q 1 1 1z 1 1 3 1 1 1 1' str = 'q 1 1 1z 1 1 3 1 1 1 1' str = 'q 1 1 1z 1 1 3 1 1 1 1' str = 'q 1 1 1z 1 1 3 1 1 1 1' str = ' 10 1 1 1 10 1 1 3 1 1 1 1'

4   Pass
str = 'quartz'; score = 24; assert(isequal(scrabble_score(str),score))

str = 'q 1 1 1 1z' str = 'q 1 1 1 1z' str = 'q 1 1 1 1z' str = 'q 1 1 1 1z' str = 'q 1 1 1 1z' str = 'q 1 1 1 1z' str = ' 10 1 1 1 1 10'

5   Pass
str = 'jackal'; score = 19; assert(isequal(scrabble_score(str),score))

str = 'j 1ck 1 1' str = 'j 1ck 1 1' str = 'j 1 3k 1 1' str = 'j 1 3k 1 1' str = 'j 1 3 5 1 1' str = ' 8 1 3 5 1 1' str = ' 8 1 3 5 1 1'

### Community Treasure Hunt

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

Start Hunting!