Skip to content

Instantly share code, notes, and snippets.

@lyntco
Last active August 29, 2015 14:07
Show Gist options
  • Save lyntco/038143e277dafd4a8f1e to your computer and use it in GitHub Desktop.
Save lyntco/038143e277dafd4a8f1e to your computer and use it in GitHub Desktop.
Quiz - Letter blocks

Quiz Letter blocks

You are given a collection of ABC blocks. Just like the ones you had when you were a kid. There are twenty blocks with two letters on each block. You are guaranteed to have a complete alphabet amongst all sides of the blocks. The sample blocks are:

[['B','O'],
['X','K'],
['D','Q'],
['C','P'],
['N','A'],
['G','T'],
['R','E'],
['T','G'],
['Q','D'],
['F','S'],
['J','W'],
['H','U'],
['V','I'],
['A','N'],
['E','R'],
['F','S'],
['L','Y'],
['P','C'],
['Z','M'],]

If you test these words, these results will happen:

can_make_word("A")
# => true
can_make_word("BARK")
# => true
can_make_word("BOOK")
# => false
can_make_word("TREAT")
# => true
can_make_word("COMMON")
# => false
can_make_word("SQUAD")
# => true
can_make_word("CONFUSE")
# => true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment