Project Euler #206: Concealed Square

  • + 0 comments

    Passed only 16 cases...Time limit exceeded :/

    and it is marked as "Easy" ಥ_ಥ

    import itertools
    n = int(input())
    fuc = 0
    s = list(map(int, input().split()))
    flag = 0
    res = [0]*(2*n-1)
    for i in range(0, 2 * n, 2):
        res[i] = s[flag]
        flag = flag+1
    for i in itertools.count(start=10):
        fuc = (i*i)
        square = list(map(int, str(fuc)))
        if (res[::2] == square[::2]):
            print(i)
            break