Recursion & DP Target: 15s
Subset backtracking explores include/exclude decisions. Foundation for power set and combination sum.
def bt(i, cur):
res.append(cur[:])
for j in range(i, n):
cur.append(a[j])
bt(j + 1, cur)
cur.pop()
bt(0, [])
Type it from memory. Go.