Skip to content

Latest commit

 

History

History
20 lines (18 loc) · 420 Bytes

File metadata and controls

20 lines (18 loc) · 420 Bytes

Lamarck      

3498 字符串的反转度


01 随便写写

class Solution(object):
    def reverseDegree(self, s):
        """
        :type s: str
        :rtype: int
        """
        ans = 0
        for index in range(len(s)):
            loc = index + 1
            value = ord("z") - ord(s[index]) + 1
            ans += loc*value
        return ans