Backtracking

Use backtracking to solve this class of problems including subsets, permutations, combinations, etc. Core idea is summarized here. Subsets (Naive) Given an integer array of distinct integers, find all possible subsets of the input array. Cannot have duplicates. Walk through the input. For each iteration, duplicate the current result list and insert them back. At […]