Project Euler #223: Almost right-angled triangles I

  • + 0 comments

    Can you explain me why this is not getting result against the testcases. Sample one Ok. but others not

    def calTriangles(N):
        triangle = [[a,b,c]for a in range(1,N) for b in range(1,N) for c in range(1,N) if a**2+b**2==c**2+1 and a+b+c<=N and a<=b and b<=c]
        return len(triangle);
    
    
    Q = int(input())
    if Q>=1 and Q<=50:
        for i in range(Q):
            N = int(input())
            print(calTriangles(N))