1class Solution:2 def distinctSubseqII(self, s: str) -> int:3 # number of subsequences that startwith each alphabet4 startwith = [0] * 265 for c in s[::-1]:6 startwith[ord(c) - ord("a")] = sum(startwith) + 17 return sum(startwith) % (10**9 + 7)
WPM •0 •0
ACC •0 •0
TIME •0