Skip to content

Latest commit

 

History

History

301-scrabbleScore

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

scrabbleScore

Interview question of the issue #301 of rendezvous with cassidoo.

The Question

Given a string, calculate the score that it would get in a game of Scrabble. For extra credit, try verifying if the string is a valid word, or take into account premium squares!

Scoring and example:

/*
1 point: E, A, I, O, N, R, T, L, S, U
2 points: D, G
3 points: B, C, M, P
4 points: F, H, V, W, Y
5 points: K
8 points: J, X
10 points: Q, Z
*/

> scrabbleScore('FIZZBUZZ')
> 49

Installing & Running

Just pnpm i to install all dependencies and then pnpm t to run the tests!