← Back to challenges

Wild Tiles

PythonHardstringsvalidationgames

Instructions

Write a function that returns True if it is possible to build a string with a particular scrabble hand.

Examples

can_build("quavers", ["S", "U", "Q", "V", "A", "#", "#"]) ➞ True

can_build("move", ["M", "U", "T", "V", "E", "J", "#"]) ➞ True

can_build("move", ["M", "U", "T", "V", "E", "J", "S"]) ➞ False

can_build("sharp", ["S", "K", "H", "#", "#", "F", "F"]) ➞ False

Notes

Hashtags "#" represent wild tiles.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.