You are viewing a single comment's thread. Return to all comments →
Can u please tell me the difference ?? Mine one is getting timeout error in some test cases .
a=raw_input() b=int(raw_input()) solvec=[] solvec.append((ord(a[0]))-96) count=1 for i in range (1,len(a),1): if a[i]==a[i-1]: count=count+1 solvec.append((ord(a[i])-96)*count) else : count=1 solvec.append(ord(a[i])-96) for i in range (b): c=int(raw_input()) if c in solvec: print "Yes" else : print "No"
Seems like cookies are disabled on this browser, please enable them to open this website
Weighted Uniform Strings
You are viewing a single comment's thread. Return to all comments →
Can u please tell me the difference ?? Mine one is getting timeout error in some test cases .