Interview question of the issue #301 of rendezvous with cassidoo.
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
Just pnpm i
to install all dependencies and then pnpm t
to run the tests!