comefrom: <doocs>0467.Unique Substrings in Wraparound String_1.py
code: def findSubstringInWraproundString( p: str) -> int:
      dp = [0] * 26
      k = 0
      for i, c in enumerate(p):
          if i and (ord(c) - ord(p[i - 1])) % 26 == 1:
              k += 1
          else:
              k = 1
          idx = ord(c) - ord('a')
          dp[idx] = max(dp[idx], k)
      return sum(dp)
masked: def sample_funcname ( var_0 : str ) -> int :
      var_5 = [ 0 ] * 26
      var_6 = 0
      for var_8 , var_9 in enumerate ( var_0 ) :
          if var_8 and ( ord ( var_9 ) - ord ( var_0 [ var_8 - 1 ] ) ) % 26 == 1 :
              var_6 += 1
          else :
              var_6 = 1
          var_13 = ord ( var_9 ) - ord ( 'a' )
          var_5 [ var_13 ] = max ( var_5 [ var_13 ] , var_6 )
      return sum ( var_5 )
  