backtrack(start, path)
that takes the starting index and the current subset path as arguments.start
equals the length of the input array, add a copy of path
to the result list, as it represents a complete subset.start
index to the end of the array.i
, add it to the path
.backtrack(i + 1, path)
to continue building the subset.path
.