input: Write a function to convert a number to words.
  assert number_to_words(259) == "twohundred fifty nine"
  assert number_to_words(0) == "zero"
  assert number_to_words(14) == "fourteen"
  assert number_to_words(305) == "threehundred five"
output: def number_to_words(num):
      if num == 0:
          return "zero"
      
      ones = ["", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"]
      teens = ["", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"]
      tens = ["", "ten", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"]
      hundreds = ["", "onehundred", "twohundred", "threehundred", "fourhundred", "fivehundred", "sixhundred", "sevenhundred", "eighthundred", "ninehundred"]
      
      word = ""
      
      if num // 100 > 0:
          word += hundreds[num // 100]
          num %= 100
      
      if 10 < num < 20:
          word += teens[num - 10]
      else:
          word += tens[num // 10]
          if num // 10 > 0 and num % 10 > 0:
              word += " "
          word += ones[num % 10]
      
      return word.strip()