Blue Bridge Cup Python Group - Substring Score

Blue Bridge Cup Python Group - Substring Score

insert image description here
insert image description here

s=input()
ans=0
for i in range(len(s)):
    for j in range(i,len(s)+1):
        s1=s[i:j]
        for k in s1:
            if s1.count(k)==1:
                ans+=1
print(ans)

Thank you for your support. Your one-click three-connection is the biggest driving force for Ganggang students!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324321877&siteId=291194637