You are viewing a single comment's thread. Return to all 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))
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #223: Almost right-angled triangles I
You are viewing a single comment's thread. Return to all comments →
Can you explain me why this is not getting result against the testcases. Sample one Ok. but others not