You are given with a list of positive integers nums, return whether there exist integers a, b, and c such that a ** 2 + b ** 2 = c ** 2.
ls=list(map(int,input().split()))
for a in range(len(ls)-2):
for b in range(a+1,len(ls)-1):
for c in range(b+1,len(ls)):
if ls[a]**2+ls[b]**2==ls[c]**2:
print([ls[a],ls[b],ls[c]])
Comments
Leave a comment