Wild Tiles

Published by Helen Yu in

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.

Watch a quick demo on how Edabit works.