codeforces/672B_good.py
def calculate(self):
        """ Main calcualtion function of the class """

        freq = [0]*26
        for c in self.s:
            ltr = ord(c) - ord('a')
            freq[ltr] += 1

        zeroes = 0
        extra = 0
        for n in freq:
            if n == 0:
                zeroes += 1
            if n > 1:
                extra += n - 1

        result = -1 if extra > zeroes else extra

        return str(result)
 Main calcualtion function of the class 
Main calcualtion function of the class
Main calcualtion function of the class
def calculate(self):
        freq = [0]*26
        for c in self.s:
            ltr = ord(c) - ord('a')
            freq[ltr] += 1
        zeroes = 0
        extra = 0
        for n in freq:
            if n == 0:
                zeroes += 1
            if n > 1:
                extra += n - 1
        result = -1 if extra > zeroes else extra
        return str(result)
def calculate ( self ) : freq = [ 0 ] * 26 for c in self . s : ltr = ord ( c ) - ord ( 'a' ) freq [ ltr ] += 1 zeroes = 0 extra = 0 for n in freq : if n == 0 : zeroes += 1 if n > 1 : extra += n - 1 result = - 1 if extra > zeroes else extra return str ( result )
Main calcualtion function of the class
Main calcualtion function of the class
""" Main calcualtion function of the class """
self