class uniqueinstr:

    @staticmethod
    def count(string):
        d = {}
        for ch in string:
            d[ch] = d.get(ch, 0) + 1
        return d

    @staticmethod
    def as_dict(string):
        return uniqueinstr.count(string)

    @staticmethod
    def as_list(string):
        return list(uniqueinstr.count(string).items())

    @staticmethod
    def max(string):
        counts = uniqueinstr.count(string)
        max_val = max(counts.values())
        return [(k, v) for k, v in counts.items() if v == max_val]

    @staticmethod
    def min(string):
        counts = uniqueinstr.count(string)
        min_val = min(counts.values())
        return [(k, v) for k, v in counts.items() if v == min_val]

    @staticmethod
    def unique(string):
        counts = uniqueinstr.count(string)
        return [(k, v) for k, v in counts.items() if v == 1]
    
class stringinfo:

    @staticmethod
    def length(string):
        return len(string)

    @staticmethod
    def palindrome(string):
        return string == string[::-1]

    @staticmethod
    def reversed(string):
        return string[::-1]

    @staticmethod
    def words(string):
        return string.split()

    @staticmethod
    def without_spaces(string):
        return string.replace(" ", "")
    
