• + 0 comments

    My solution:

    import re
    
    string = input()
    sample = input()
    matches = list(re.finditer(rf"(?={sample})", string))
    
    if (matches == []):
        print((-1, -1))
    for word in matches:
        print(tuple((word.start(), word.start() + len(sample) - 1 )))