elemnts=[2,2,0,0,5,6]
h1=9
h2=6
def func(elemts,a,b):
list1=[]
for i in range(0,len(elemts)):
for j in range(i+1,len(elemts)):
for k in range(0,len(elemts)):
if(k not in [i,j]):
temp=elemts[i]+elemts[j]+elemts[k]
if(temp in [h1,h2]):
list1.extend([elemts[i],elemts[j],elemts[k]])
return list1
list2=func(elemnts,h1,h2)
@arthur_currry…just chnged one line in last if case.Its working fine
solved Given a 6 blocks, of different height h1, h2 . Make 2 towers using 3 Blocks for each tower in desired height h1, h2