2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -1,37 +1,44 @@
|
|||
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:
|
||||
You are given a collection of ABC blocks (maybe like the ones you had when you were a kid).
|
||||
|
||||
There are twenty blocks with two letters on each block.
|
||||
|
||||
A complete alphabet is guaranteed amongst all sides of the blocks.
|
||||
|
||||
The sample collection of blocks:
|
||||
(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)
|
||||
(O B)
|
||||
(E R)
|
||||
(F S)
|
||||
(L Y)
|
||||
(P C)
|
||||
(Z M)
|
||||
|
||||
|
||||
;Task:
|
||||
Write a function that takes a string (word) and determines whether the word can be spelled with the given collection of blocks.
|
||||
|
||||
:((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)
|
||||
: (O B)
|
||||
: (E R)
|
||||
: (F S)
|
||||
: (L Y)
|
||||
: (P C)
|
||||
: (Z M))
|
||||
|
||||
The goal of this task is to write a function that takes a string and can determine whether you can spell the word with the given collection of blocks.
|
||||
The rules are simple:
|
||||
::# Once a letter on a block is used that block cannot be used again
|
||||
::# The function should be case-insensitive
|
||||
::# Show the output on this page for the following 7 words in the following example
|
||||
|
||||
#Once a letter on a block is used that block cannot be used again
|
||||
#The function should be case-insensitive
|
||||
# Show your output on this page for the following words:
|
||||
|
||||
;Example:
|
||||
|
||||
<lang python>
|
||||
>>> can_make_word("A")
|
||||
<lang python> >>> can_make_word("A")
|
||||
True
|
||||
>>> can_make_word("BARK")
|
||||
True
|
||||
|
|
@ -44,5 +51,5 @@ The rules are simple:
|
|||
>>> can_make_word("SQUAD")
|
||||
True
|
||||
>>> can_make_word("CONFUSE")
|
||||
True
|
||||
</lang>
|
||||
True</lang>
|
||||
<br><br>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue