Project Euler #206: Concealed Square

  • + 0 comments

    n=int(input()) q=input() q1=q.split(" ") x="" for q2 in q1: x=x+q2 a1=list(x) s="" l=len(a1) for i in range((10(l-1)),(10l)): sq=1 s="" sq1=[] sq=i*i sq1=list(str(sq)) for j in range(0,(len(sq1)),2): s=s+sq1[j] if s == x: print(i) break**

    My solution passed 16 test cases only. Rest all the cases aborted due to timeout. Any suggestions to reduce calculation time. My code is in python.