You are viewing a single comment's thread. Return to all comments →
My best attempt:
from re import finditer, escape s = input() k = input() r = '(?=(' + escape(k) + '))' if k in s: for m in finditer(r, s): print((m.start(1), m.end(1)-1)) else: print((-1, -1))
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 →
My best attempt: