You are viewing a single comment's thread. Return to all comments →
without using regex
string_S = input() string_k = input() len_S = len(string_S) len_k = len(string_k) listed_script = [] for idS in range(len_S): if(idS+(len_k-1)<len_S): if ''.join([string_S[idS+idk] for idk in range(len_k)]) == string_k: listed_script.append((idS,idS+(len_k-1))) if(len(listed_script)==0): listed_script.append((-1,-1)) for lsc in listed_script: print(lsc)
Seems like cookies are disabled on this browser, please enable them to open this website
Re.start() & Re.end()
You are viewing a single comment's thread. Return to all comments →
without using regex