In the Byteland country a string "S" is said to super ascii string if and only if count of each character in the string is equal to its ascii value.
In the Byteland country ascii code of 'a' is 1, 'b' is 2 ...'z' is 26.
Your task is to find out whether the given string is a super ascii string or not.
Ans in python: S=input () L=[] for i in range(0,26): L.append(i)
L[i]=0 for i in range(0,len(s)): K= ord(s[i]-97 L[k]=l[k]+1 for i in
range(0,26): C=0 if (l[i]==i+1 or l[i]==0): C=1 else: C=0 break
if(c!=0): print("yes") else: print("no")
Leave a comment
Thank you! Your comments have been successfully added. However, they need to be checked by the moderator before being published.
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Ans in python: S=input () L=[] for i in range(0,26): L.append(i) L[i]=0 for i in range(0,len(s)): K= ord(s[i]-97 L[k]=l[k]+1 for i in range(0,26): C=0 if (l[i]==i+1 or l[i]==0): C=1 else: C=0 break if(c!=0): print("yes") else: print("no")
Leave a comment