Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
native_count_chains solution in Uncategorized category for Count Chains by Jon_Red
def count_chains(c:list(tuple([int,int,int]))):
f=lambda a,b:a[2]+b[2]>((a[0]-b[0])**2+(a[1]-b[1])**2)**(.5)>abs(b[2]-a[2])
d,s={0:[c.pop()]},len(c)
while c:
if s:
for i in d:
d[i]+=[c.pop(c.index(b))for a in d[i]for b in c if f(a,b)]
else:s-=1
else:d[i+1],s=[c.pop()],len(c)
return len(d)
June 2, 2020