input: Write a function to determine the total number of common characters present in both strings. The function should take two strings as input and return an integer representing the count of common characters. Perform this by iterating through the first string and checking if each character exists in the second string, maintaining a count of such characters. If either string is empty, the function should return 0.
  
  assert num_common_chars("python", "typhon")==6
  assert num_common_chars("hello", "world")==2
  assert num_common_chars("abc", "def")==0
  assert num_common_chars("", "hello")==0
  assert num_common_chars("programming", "algorithm")==5
output: def num_common_chars(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