input: Write a function that takes in two strings and returns an integer indicating the number of common characters between the two strings. If either of the strings is empty, the function should return 0.
  
  
  def num_common_characters(s1, s2):
      count = 0
      for char in s1:
          if char in s2:
              count += 1
      return count
  
  assert num_common_characters("abcd", "bae") == 2
  assert num_common_characters("hello", "world") == 3
  assert num_common_characters("abc", "def") == 0
  assert num_common_characters("", "bae") == 0
  assert num_common_characters("abcd", "") == 0
  
output: def num_common_characters(s1, s2):
      if not s1 or not s2:
          return 0
      count = 0
      for char in s1:
          if char in s2:
              count += 1
              s2 = s2.replace(char, '', 1)
      return count