Given a word, determine its score in Scrabble.
The input string will always be provided in lower case. Use the English language Scrabble letter values as found in this Wikipedia reference: letter distributions for English.
Example:
Input str = 'matlab' Output score is 10.
Solution Stats
Problem Comments
2 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers2177
Suggested Problems
-
Make the vector [1 2 3 4 5 6 7 8 9 10]
53253 Solvers
-
Maximum running product for a string of numbers
2257 Solvers
-
The Hitchhiker's Guide to MATLAB
3412 Solvers
-
Given a window, how many subsets of a vector sum positive
873 Solvers
-
Who has power to do everything in this world?
487 Solvers
More from this Author96
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Why don't you provide the counting system inside the function? What's the point of retyping it from wiki?
@Jonas
I agree
case {'l','s','u','n','r','t','o','a','i','e'}
score=1
case {'g','d'}
score=2
case {'b','c','m','p'}
score=3
case {'f','h','v','w','y'}
score=4
case {'k'}
score=5
case {'j','x'}
score=8
case {'q','z'}
score=10