Review: Combinations and Permutations Problems Posted on January 22, 2018July 26, 2020 by braindenny Combinations and Permutations Problems Sample Problems: LeetCode: Combination Sum III Code Skeleton: func dfs(combination []int, pos int, nums []int, res *[][]int) { // No need to keep going if (...) { *res = append(*res, combination) } // Add nums[pos] for i:=pos; i<len(nums); i++ { // deep copy combination2 := make([]int, len(combination)) copy(combination2, combination) combination2 = append(combination2, nums[i]) dfs(combination2, i+1, nums, res) } } // main function CheatSheet: Leetcode For Code Interview CheatSheet: Common Code Problems & Follow-ups See all combination: #combination Review: Combinations and Permutations ProblemsLintCode: Subset With TargetLintCode: Prime ProductLeetCode: Subsets IILeetCode: SubsetsLeetCode: Pyramid Transition MatrixLeetCode: Permutations IILeetCode: PermutationsLeetCode: Permutation SequenceLeetCode: Partition Equal Subset SumLeetCode: Palindrome Permutation IILeetCode: Next PermutationLeetCode: Letter Tile PossibilitiesLeetCode: Letter Combinations of a Phone NumberLeetCode: Letter Case PermutationLeetCode: Largest Time for Given DigitsLeetCode: Generalized AbbreviationLeetCode: Find PermutationLeetCode: Decode WaysLeetCode: CombinationsLeetCode: Combination Sum IVLeetCode: Combination Sum IIILeetCode: Combination Sum IILeetCode: Combination SumLeetCode: Brace ExpansionLeetCode: Binary WatchLeetCode: Arithmetic SlicesLeetCode: Ambiguous CoordinatesLeetCode: 3Sum With Multiplicity See more blog posts. Post Views: 7