input: Write a function to compare characters in two strings and return a dictionary of their occurrences.
  assert StringCompare("hello", "world").compare_strings() == {'o': 1, 'l': 2}
  assert StringCompare("apple", "pineapple").compare_strings() == {'a': 1, 'p': 3, 'l': 1, 'e': 2}
  assert StringCompare("abcd", "efgh").compare_strings() == {}
output: class StringCompare:
      def __init__(self, str1, str2):
          self.str1 = str1
          self.str2 = str2
  
      def compare_strings(self):
          occurrences = {}
          for char in set(self.str1).intersection(set(self.str2)):
              occurrences[char] = min(self.str1.count(char), self.str2.count(char))
          return occurrences