now I'm getting [810, 569, 296] [670, 631, 270, 104] but I want to get position like [4, 10, 16] [8, 9, 17, 19]
def getSum(total,A,result=[]):
for i,n in enumerate(A):
if n==total: yield result+[n]
if n>=total: continue
yield from getSum(total-n,A[i+1:],result+[n])
for items in getSum(1675,[991, 969, 841, 810, 793, 790, 728, 670, 631, 569, 525, 499, 447, 431, 307, 296, 270, 229, 104]):
print(items)