input: Write a function to check if all characters in a string are in a list of words.
  assert word_set("justdoit", ["just", "do", "it"]) == True
  assert word_set("hello", ["hi", "hello", "world"]) == True
  assert word_set("apple", ["a", "p", "l", "e"]) == False
output: def word_set(s, words):
      words_set = set(words)
      i = 0
      while i < len(s):
          matched = False
          for word in words_set:
              if s[i:i+len(word)] == word:
                  i += len(word)
                  matched = True
                  break
          if not matched:
              return False
      return True