Cody

# Problem 56. Scrabble Scores

Solution 1181950

Submitted on 5 May 2017 by Jihye Sofia Seo
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))

coef = 1 3 3 2 1 4 2 4 1 8 5 1 3 1 1 3 10 1 1 1 1 4 4 8 4 10 numArray = 0 score = 0 len = 1 ind = 1 score = 1 ind = 2

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

coef = 1 3 3 2 1 4 2 4 1 8 5 1 3 1 1 3 10 1 1 1 1 4 4 8 4 10 numArray = 12 0 19 11 0 1 score = 0 len = 6 ind = 1 score = 3 ind = 2 score = 4 ind = 3 score = 5 ind = 4 score = 6 ind = 5 score = 7 ind = 6 score = 10 ind = 7

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

coef = 1 3 3 2 1 4 2 4 1 8 5 1 3 1 1 3 10 1 1 1 1 4 4 8 4 10 numArray = 16 20 4 19 25 0 11 2 14 0 19 11 score = 0 len = 12 ind = 1 score = 10 ind = 2 score = 11 ind = 3 score = 12 ind = 4 score = 13 ind = 5 score = 23 ind = 6 score = 24 ind = 7 score = 25 ind = 8 score = 28 ind = 9 score = 29 ind = 10 score = 30 ind = 11 score = 31 ind = 12 score = 32 ind = 13

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

coef = 1 3 3 2 1 4 2 4 1 8 5 1 3 1 1 3 10 1 1 1 1 4 4 8 4 10 numArray = 16 20 0 17 19 25 score = 0 len = 6 ind = 1 score = 10 ind = 2 score = 11 ind = 3 score = 12 ind = 4 score = 13 ind = 5 score = 14 ind = 6 score = 24 ind = 7

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

coef = 1 3 3 2 1 4 2 4 1 8 5 1 3 1 1 3 10 1 1 1 1 4 4 8 4 10 numArray = 9 0 2 10 0 11 score = 0 len = 6 ind = 1 score = 8 ind = 2 score = 9 ind = 3 score = 12 ind = 4 score = 17 ind = 5 score = 18 ind = 6 score = 19 ind = 7

### Community Treasure Hunt

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

Start Hunting!