September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -1,12 +1,12 @@
|
|||
defmodule ABC do
|
||||
def can_make_word(word, avail) do
|
||||
can_make_word(String.upcase(word) |> to_char_list, avail, [])
|
||||
can_make_word(String.upcase(word) |> to_charlist, avail, [])
|
||||
end
|
||||
|
||||
defp can_make_word([], _, _), do: true
|
||||
defp can_make_word(_, [], _), do: false
|
||||
defp can_make_word([l|tail], [b|rest], tried) do
|
||||
(Enum.member?(b,l) and can_make_word(tail, rest++tried, []))
|
||||
(l in b and can_make_word(tail, rest++tried, []))
|
||||
or can_make_word([l|tail], rest, [b|tried])
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue