input: Write a python function to categorize a list of words based on predefined categories and return a dictionary.
  assert categorize_words(["carpet", "chair", "table", "floor"]) == {"furnishing": ["carpet"], "furniture": ["chair", "table"], "flooring": ["floor"]}
  assert categorize_words(["chair", "table", "sofa"]) == {"furniture": ["chair", "table"], "other": ["sofa"]}
  assert categorize_words(["carpet", "floor", "lamp"]) == {"furnishing": ["carpet"], "flooring": ["floor"], "other": ["lamp"]}
output: def categorize_words(words):
      categories = {
          "furnishing": ["carpet"],
          "furniture": ["chair", "table"],
          "flooring": ["floor"]
      }
      categorized = {"furnishing": [], "furniture": [], "flooring": [], "other": []}
  
      for word in words:
          found = False
          for category, items in categories.items():
              if word in items:
                  categorized[category].append(word)
                  found = True
                  break
          if not found:
              categorized["other"].append(word)
  
      # Remove empty categories
      categorized = {k: v for k, v in categorized.items() if v}
      return categorized