input: def min_balanced_partitions(s: str) -> int:
      """
      Given a string s, partition it into the fewest number of balanced substrings possible. For example, if s == "ababcc" then ("abab", "c", "c"), ("ab", "abc", "c"), and ("ababcc") are all valid partitions, but ("a", "bab", "cc"), ("aba", "bc", "c"), and ("ab", "abcc") are not. The unbalanced substrings are emphasized.
  
      Return the minimum count of substrings s can be divided into.
  
      Note: A balanced substring has each character appearing the same number of times.
  
      Examples:
      >>> s = "fabccddg"
      3
      >>> s = "abababaccddb"
      2
  
      Constraints:
      1 <= s.length <= 1000
      s consists only of English lowercase letters.
      """
output:     
      from collections import Counter
  
      def is_balanced(substring):
          count = Counter(substring)
          values = list(count.values())
          return all(v == values[0] for v in values)
  
      def min_balanced_partitions(s: str) -> int:
          def helper(s, start):
              n = len(s)
              if start == n:
                  return 0
              min_parts = float('inf')
              for end in range(start + 1, n + 1):
                  if is_balanced(s[start:end]):
                      min_parts = min(min_parts, 1 + helper(s, end))
              return min_parts
          
          return helper(s, 0)
  