input: Write a function to find the total number of common characters present in both strings. If any of the strings is empty then return 0.
  def num_common_chars(str1, str2):
      common = 0
      if not str1 or not str2:
          return common
      for c in set(str1):
          if c in str2:
              common += min(str1.count(c), str2.count(c))
      return common
  
  assert num_common_chars("hello", "world")==2
  assert num_common_chars("banana", "anaconda")==5
  assert num_common_chars("apple", "")==0
  assert num_common_chars("", "pear")==0
  assert num_common_chars("", "")==0
output: def num_common_chars(str1, str2):
      common = 0
      if not str1 or not str2:
          return common
      for c in set(str1):
          if c in str2:
              common += min(str1.count(c), str2.count(c))
      return common