- 100
Learning Opportunities
This puzzle can be solved using the following concepts. Practice using these concepts and improve your skills.
Statement
Goal
Given the tile set, with the tile scores,given the board, with double/triple letter/word score cells,
given the board with words already played,
and given the updated board with the word you have just played,
you have to compute how many points you scored by playing this word.
How to compute your score
There are 4 kinds of special cells :
The score is calculated by first summing up the scores of the tiles. If any tile just played falls on
If you play on several
There are enough test cases to illustrate how scoring works in practice.
More details about the real scrabble game here :
https://en.wikipedia.org/wiki/Scrabble
https://fr.wikipedia.org/wiki/Scrabble
Input
First line: the number of characters nbTiles in the tile set.
nbTiles following lines: a character and an integer, which is the associated score, space separated. The character may or may not be a letter.
Next line: width and height of the board, space separated.
height following lines: the empty board with double letter scorel , triple letter score L , double word score w , triple word score W , or normal cell . .
height following lines: the board with words already played (characters in the tile set, or. for empty cell).
height following lines: the board with words already played and the word you've just played (characters in the tile set, or. for empty cell).
nbTiles following lines: a character and an integer, which is the associated score, space separated. The character may or may not be a letter.
Next line: width and height of the board, space separated.
height following lines: the empty board with double letter score
height following lines: the board with words already played (characters in the tile set, or
height following lines: the board with words already played and the word you've just played (characters in the tile set, or
Output
As many lines as necessary, in lexicographical order: Each new word with associated score, space separated.
One more line:Bonus 50 if 7 new tiles are played.
Last line:Total followed by a space and the total points scored.
One more line:
Last line:
Constraints
2 <= nbTiles <= 30
4 <= width, height <= 15
There are at least 1 and at most 7 new tiles played.
All new tiles are lined up.
At least 1 new tile is near a previously played tile.
There won't be two identical new words.
4 <= width, height <= 15
There are at least 1 and at most 7 new tiles played.
All new tiles are lined up.
At least 1 new tile is near a previously played tile.
There won't be two identical new words.
Example
Input
27 A 1 B 3 C 3 D 2 E 1 F 4 G 2 H 4 I 1 J 8 K 5 L 1 M 3 N 1 O 1 P 3 Q 8 R 1 S 1 T 1 U 1 V 4 W 4 X 8 Y 4 Z 10 _ 0 4 4 W..w .... .... l..L .... .OR. .... .... .... .OR. .F.. ....
Output
OF 5 Total 5
A higher resolution is required to access the IDE