Buggy python submission (verdict: Runtime Error):
import sys
read = sys.stdin.read
#readlines = sys.stdin.readlines
#from collections import defaultdict
from numba import njit
import numpy as np
def main():
    @njit()
    def s(k):
        rems = np.zeros(k)
        n = 7
        next_digit = 70
        r = 1
        while True:
            rem = n % k
            if rem == 0:
                break
            elif rems[rem]:
                r = -1
                break
            else:
                rems[rem] = 1
                n += next_digit
                next_digit *= 10
                r += 1
        return r
    k = int(input())
    if k % 2 == 0:
        print(-1)
    else:
        print(s(k))


if __name__ == '__main__':
    main()


Fixed submission:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    k = int(input())
    if k % 2 == 0 or k % 5 == 0:
        print(-1)
        sys.exit()
    p = 7
    plus = 7
    amari = set()
    r = 1
    while (p % k) != 0:
        if p in amari:
            print(r, -1, p)
            sys.exit()
        else:
            amari.add(p)
            plus = (plus * 10) % k
            p += plus
            p = p % k
            r += 1
    print(r)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
read = sys.stdin.read
#readlines = sys.stdin.readlines
from collections import defaultdict
def main():
    k = int(input())
    if k % 2 == 0:
        print(-1)
        sys.exit()
    rems = defaultdict(int)
    n = 7
    next_digit = 70
    r = 1
    while True:
        rem = n % k
        if rem == 0:
            print(r)
            sys.exit()
        elif rems[rem]:
            print(-1)
            sys.exit()
        else:
            rems[rem] = 1
            n += next_digit
            next_digit *= 10
            r += 1
if __name__ == '__main__':
    main()

Fixed submission:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    k = int(input())
    if k % 2 == 0 or k % 5 == 0:
        print(-1)
        sys.exit()
    p = 7
    plus = 7
    amari = set()
    r = 1
    while (p % k) != 0:
        if p in amari:
            print(r, -1, p)
            sys.exit()
        else:
            amari.add(p)
            plus = (plus * 10) % k
            p += plus
            p = p % k
            r += 1
    print(r)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from math import sqrt
def main():
    k = int(input())
    if k % 2 == 0:
        print(-1)
        sys.exit()
    ok = k
    while True:
        ks = str(k)
        ksc = [c == '7' for c in ks]
        if all(ksc):
            r = len(ks)
            print(r)
            sys.exit()
        else:
            k += ok

if __name__ == '__main__':
    main()

Fixed submission:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    k = int(input())
    if k % 2 == 0 or k % 5 == 0:
        print(-1)
        sys.exit()
    p = 7
    plus = 7
    amari = set()
    r = 1
    while (p % k) != 0:
        if p in amari:
            print(r, -1, p)
            sys.exit()
        else:
            amari.add(p)
            plus = (plus * 10) % k
            p += plus
            p = p % k
            r += 1
    print(r)

if __name__ == '__main__':
    main()