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.