8000 leetcode/src/subsets/subsets.cpp at master · wwh51/leetcode · GitHub
[go: up one dir, main page]

Skip to content
{"payload":{"allShortcutsEnabled":false,"fileTree":{"src/subsets":{"items":[{"name":"subsets.II.cpp","path":"src/subsets/subsets.II.cpp","contentType":"file"},{"name":"subsets.cpp","path":"src/subsets/subsets.cpp","contentType":"file"}],"totalCount":2},"src":{"items":[{"name":"3Sum","path":"src/3Sum","contentType":"directory"},{"name":"3SumClosest","path":"src/3SumClosest","contentType":"directory"},{"name":"4Sum","path":"src/4Sum","contentType":"directory"},{"name":"LRUCache","path":"src/LRUCache","contentType":"directory"},{"name":"addBinary","path":"src/addBinary","contentType":"directory"},{"name":"addTwoNumbers","path":"src/addTwoNumbers","contentType":"directory"},{"name":"anagrams","path":"src/anagrams","contentType":"directory"},{"name":"balancedBinaryTree","path":"src/balancedBinaryTree","contentType":"directory"},{"name":"bestTimeToBuyAndSellStock","path":"src/bestTimeToBuyAndSellStock","contentType":"directory"},{"name":"binarySearchTreeIterator","path":"src/binarySearchTreeIterator","contentType":"directory"},{"name":"binaryTreeInorderTraversal","path":"src/binaryTreeInorderTraversal","contentType":"directory"},{"name":"binaryTreeLevelOrderTraversal","path":"src/binaryTreeLevelOrderTraversal","contentType":"directory"},{"name":"binaryTreeMaximumPathSum","path":"src/binaryTreeMaximumPathSum","contentType":"directory"},{"name":"binaryTreePostorderTraversal","path":"src/binaryTreePostorderTraversal","contentType":"directory"},{"name":"binaryTreePreorderTraversal","path":"src/binaryTreePreorderTraversal","contentType":"directory"},{"name":"binaryTreeUpsideDown","path":"src/binaryTreeUpsideDown","contentType":"directory"},{"name":"binaryTreeZigzagLevelOrderTraversal","path":"src/binaryTreeZigzagLevelOrderTraversal","contentType":"directory"},{"name":"candy","path":"src/candy","contentType":"directory"},{"name":"climbStairs","path":"src/climbStairs","contentType":"directory"},{"name":"cloneGraph","path":"src/cloneGraph","contentType":"directory"},{"name":"combinationSum","path":"src/combinationSum","contentType":"directory"},{"name":"combinations","path":"src/combinations","contentType":"directory"},{"name":"compareVersionNumbers","path":"src/compareVersionNumbers","contentType":"directory"},{"name":"constructBinaryTreeFromInorderAndPostorderTraversal","path":"src/constructBinaryTreeFromInorderAndPostorderTraversal","contentType":"directory"},{"name":"constructBinaryTreeFromPreorderAndInorderTraversal","path":"src/constructBinaryTreeFromPreorderAndInorderTraversal","contentType":"directory"},{"name":"containerWithMostWater","path":"src/containerWithMostWater","contentType":"directory"},{"name":"convertSortedArrayToBinarySearchTree","path":"src/convertSortedArrayToBinarySearchTree","contentType":"directory"},{"name":"convertSortedListToBinarySearchTree","path":"src/convertSortedListToBinarySearchTree","contentType":"directory"},{"name":"copyListWithRandomPointer","path":"src/copyListWithRandomPointer","contentType":"directory"},{"name":"countAndSay","path":"src/countAndSay","contentType":"directory"},{"name":"decodeWays","path":"src/decodeWays","contentType":"directory"},{"name":"distinctSubsequences","path":"src/distinctSubsequences","contentType":"directory"},{"name":"divideTwoInt","path":"src/divideTwoInt","contentType":"directory"},{"name":"dungeonGame","path":"src/dungeonGame","contentType":"directory"},{"name":"editDistance","path":"src/editDistance","contentType":"directory"},{"name":"evaluateReversePolishNotation","path":"src/evaluateReversePolishNotation","contentType":"directory"},{"name":"excelSheetColumnNumber","path":"src/excelSheetColumnNumber","contentType":"directory"},{"name":"excelSheetColumnTitle","path":"src/excelSheetColumnTitle","contentType":"directory"},{"name":"factorialTrailingZeroes","path":"src/factorialTrailingZeroes","contentType":"directory"},{"name":"findMinimumInRotatedSortedArray","path":"src/findMinimumInRotatedSortedArray","contentType":"directory"},{"name":"findPeakElement","path":"src/findPeakElement","contentType":"directory"},{"name":"firstMissingPositive","path":"src/firstMissingPositive","contentType":"directory"},{"name":"flattenBinaryTreeToLinkedList","path":"src/flattenBinaryTreeToLinkedList","contentType":"directory"},{"name":"fractionToRecurringDecimal","path":"src/fractionToRecurringDecimal","contentType":"directory"},{"name":"gasStation","path":"src/gasStation","contentType":"directory"},{"name":"generateParentheses","path":"src/generateParentheses","contentType":"directory"},{"name":"grayCode","path":"src/grayCode","contentType":"directory"},{"name":"insertInterval","path":"src/insertInterval","contentType":"directory"},{"name":"insertionSortList","path":"src/insertionSortList","contentType":"directory"},{"name":"integerToRoman","path":"src/integerToRoman","contentType":"directory"},{"name":"interleavingString","path":"src/interleavingString","contentType":"directory"},{"name":"intersectionOfTwoLinkedLists","path":"src/intersectionOfTwoLinkedLists","contentType":"directory"},{"name":"jumpGame","path":"src/jumpGame","contentType":"directory"},{"name":"largestNumber","path":"src/largestNumber","contentType":"directory"},{"name":"largestRectangleInHistogram","path":"src/largestRectangleInHistogram","contentType":"directory"},{"name":"lengthOfLastWord","path":"src/lengthOfLastWord","contentType":"directory"},{"name":"letterCombinationsOfAPhoneNumber","path":"src/letterCombinationsOfAPhoneNumber","contentType":"directory"},{"name":"linkedListCycle","path":"src/linkedListCycle","contentType":"directory"},{"name":"longestCommonPrefix","path":"src/longestCommonPrefix","contentType":"directory"},{"name":"longestConsecutiveSequence","path":"src/longestConsecutiveSequence","contentType":"directory"},{"name":"longestPalindromicSubstring","path":"src/longestPalindromicSubstring","contentType":"directory"},{"name":"longestSubstringWithAtMostTwoDistinctCharacters","path":"src/longestSubstringWithAtMostTwoDistinctCharacters","contentType":"directory"},{"name":"longestSubstringWithoutRepeatingCharacters","path":"src/longestSubstringWithoutRepeatingCharacters","contentType":"directory"},{"name":"longestValidParentheses","path":"src/longestValidParentheses","contentType":"directory"},{"name":"majorityElement","path":"src/majorityElement","contentType":"directory"},{"name":"maxPointsOnALine","path":"src/maxPointsOnALine","contentType":"directory"},{"name":"maximalRectangle","path":"src/maximalRectangle","contentType":"directory"},{"name":"maximumDepthOfBinaryTree","path":"src/maximumDepthOfBinaryTree","contentType":"directory"},{"name":"maximumGap","path":"src/maximumGap","contentType":"directory"},{"name":"maximumProductSubarray","path":"src/maximumProductSubarray","contentType":"directory"},{"name":"maximumSubArray","path":"src/maximumSubArray","contentType":"directory"},{"name":"medianOfTwoSortedArrays","path":"src/medianOfTwoSortedArrays","contentType":"directory"},{"name":"mergeIntervals","path":"src/mergeIntervals","contentType":"directory"},{"name":"mergeKSortedLists","path":"src/mergeKSortedLists","contentType":"directory"},{"name":"mergeTwoSortedArray","path":"src/mergeTwoSortedArray","contentType":"directory"},{"name":"mergeTwoSortedList","path":"src/mergeTwoSortedList","contentType":"directory"},{"name":"minStack","path":"src/minStack","contentType":"directory"},{"name":"minimumDepthOfBinaryTree","path":"src/minimumDepthOfBinaryTree","contentType":"directory"},{"name":"minimumPathSum","path":"src/minimumPathSum","contentType":"directory"},{"name":"minimumWindowSubstring","path":"src/minimumWindowSubstring","contentType":"directory"},{"name":"missingRanges","path":"src/missingRanges","contentType":"directory"},{"name":"multiplyStrings","path":"src/multiplyStrings","contentType":"directory"},{"name":"nQueens","path":"src/nQueens","contentType":"directory"},{"name":"nextPermutation","path":"src/nextPermutation","contentType":"directory"},{"name":"oneEditDistance","path":"src/oneEditDistance","contentType":"directory"},{"name":"palindromeNumber","path":"src/palindromeNumber","contentType":"directory"},{"name":"palindromePartitioning","path":"src/palindromePartitioning","contentType":"directory"},{"name":"partitionList","path":"src/partitionList","contentType":"directory"},{"name":"pascalTriangle","path":"src/pascalTriangle","contentType":"directory"},{"name":"pathSum","path":"src/pathSum","contentType":"directory"},{"name":"permutationSequence","path":"src/permutationSequence","contentType":"directory"},{"name":"permutations","path":"src/permutations","contentType":"directory"},{"name":"plusOne","path":"src/plusOne","contentType":"directory"},{"name":"populatingNextRightPointersInEachNode","path":"src/populatingNextRightPointersInEachNode","contentType":"directory"},{"name":"pow","path":"src/pow","contentType":"directory"},{"name":"readNCharactersGivenRead4","path":"src/readNCharactersGivenRead4","contentType":"directory"},{"name":"recoverBinarySearchTree","path":"src/recoverBinarySearchTree","contentType":"directory"},{"name":"regularExpressionMatching","path":"src/regularExpressionMatching","contentType":"directory"},{"name":"removeDuplicatesFromSortedArray","path":"src/removeDuplicatesFromSortedArray","contentType":"directory"},{"name":"removeDuplicatesFromSortedList","path":"src/removeDuplicatesFromSortedList","contentType":"directory"},{"name":"removeElement","path":"src/removeElement","contentType":"directory"},{"name":"removeNthNodeFromEndOfList","path":"src/removeNthNodeFromEndOfList","contentType":"directory"},{"name":"reorderList","path":"src/reorderList","contentType":"directory"},{"name":"repeatedDNASequences","path":"src/repeatedDNASequences","contentType":"directory"},{"name":"restoreIPAddresses","path":"src/restoreIPAddresses","contentType":"directory"},{"name":"reverseInteger","path":"src/reverseInteger","contentType":"directory"},{"name":"reverseLinkedList","path":"src/reverseLinkedList","contentType":"directory"},{"name":"reverseNodesInKGroup","path":"src/reverseNodesInKGroup","contentType":"directory"},{"name":"reverseWordsInAString","path":"src/reverseWordsInAString","contentType":"directory"},{"name":"romanToInteger","path":"src/romanToInteger","contentType":"directory"},{"name":"rotateImage","path":"src/rotateImage","contentType":"directory"},{"name":"rotateList","path":"src/rotateList","contentType":"directory"},{"name":"sameTree","path":"src/sameTree","contentType":"directory"},{"name":"scrambleString","path":"src/scrambleString","contentType":"directory"},{"name":"search2DMatrix","path":"src/search2DMatrix","contentType":"directory"},{"name":"searchForRange","path":"src/searchForRange","contentType":"directory"},{"name":"searchInRotatedSortedArray","path":"src/searchInRotatedSortedArray","contentType":"directory"},{"name":"searchInsertPosition","path":"src/searchInsertPosition","contentType":"directory"},{"name":"setMatrixZeroes","path":"src/setMatrixZeroes","contentType":"directory"},{"name":"simplifyPath","path":"src/simplifyPath","contentType":"directory"},{"name":"singleNumber","path":"src/singleNumber","contentType":"directory"},{"name":"sortColors","path":"src/sortColors","contentType":"directory"},{"name":"sortList","path":"src/sortList","contentType":"directory"},{"name":"spiralMatrix","path":"src/spiralMatrix","contentType":"directory"},{"name":"sqrt","path":"src/sqrt","contentType":"directory"},{"name":"strStr","path":"src/strStr","contentType":"directory"},{"name":"stringToIntegerAtoi","path":"src/stringToIntegerAtoi","contentType":"directory"},{"name":"subsets","path":"src/subsets","contentType":"directory"},{"name":"substringWithConcatenationOfAllWords","path":"src/substringWithConcatenationOfAllWords","contentType":"directory"},{"name":"sudokuSolver","path":"src/sudokuSolver","contentType":"directory"},{"name":"sumRootToLeafNumber","path":"src/sumRootToLeafNumber","contentType":"directory"},{"name":"surroundedRegions","path":"src/surroundedRegions","contentType":"directory"},{"name":"swapNodesInPairs","path":"src/swapNodesInPairs","contentType":"directory"},{"name":"symmetricTree","path":"src/symmetricTree","contentType":"directory"},{"name":"textJustification","path":"src/textJustification","contentType":"directory"},{"name":"trappingRainWater","path":"src/trappingRainWater","contentType":"directory"},{"name":"triangle","path":"src/triangle","contentType":"directory"},{"name":"twoSum","path":"src/twoSum","contentType":"directory"},{"name":"uniqueBinarySearchTrees","path":"src/uniqueBinarySearchTrees","contentType":"directory"},{"name":"uniquePaths","path":"src/uniquePaths","contentType":"directory"},{"name":"validNumber","path":"src/validNumber","contentType":"directory"},{"name":"validPalindrome","path":"src/validPalindrome","contentType":"directory"},{"name":"validParentheses","path":"src/validParentheses","contentType":"directory"},{"name":"validSudoku","path":"src/validSudoku","contentType":"directory"},{"name":"validateBinarySearchTree","path":"src/validateBinarySearchTree","contentType":"directory"},{"name":"wildcardMatching","path":"src/wildcardMatching","contentType":"directory"},{"name":"wordBreak","path":"src/wordBreak","contentType":"directory"},{"name":"wordLadder","path":"src/wordLadder","contentType":"directory"},{"name":"wordSearch","path":"src/wordSearch","contentType":"directory"},{"name":"zigZagConversion","path":"src/zigZagConversion","contentType":"directory"}],"totalCount":150},"":{"items":[{"name":"scripts","path":"scripts","contentType":"directory"},{"name":"src","path":"src","contentType":"directory"},{"name":"README.md","path":"README.md","contentType":"file"}],"totalCount":3}},"fileTreeProcessingTime":12.846231,"foldersToFetch":[],"incompleteFileTree":false,"repo":{"id":31525404,"defaultBranch":"master","name":"leetcode","ownerLogin":"wwh51","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2015-03-02T05:51:38.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/4229652?v=4","public":true,"private":false,"isOrgOwned":false},"codeLineWrapEnabled":false,"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"master","listCacheKey":"v0:1620893130.8052428","canEdit":false,"refType":"branch","currentOid":"44c2860a387d6df4c51ff3346dc86ce18a557e6f"},"path":"src/subsets/subsets.cpp","currentUser":null,"blob":{"rawLines":["// Source : https://oj.leetcode.com/problems/subsets/","// Author : Hao Chen","// Date : 2014-07-03","","/********************************************************************************** ","* ","* Given a set of distinct integers, S, return all possible subsets.","* ","* Note:","* ","* Elements in a subset must be in non-descending order.","* The solution set must not contain duplicate subsets.","* ","* For example,","* If S = [1,2,3], a solution is:","* ","* [","* [3],","* [1],","* [2],","* [1,2,3],","* [1,3],","* [2,3],","* [1,2],","* []","* ]","* ","* ","**********************************************************************************/","","#include \u003cstdio.h\u003e","#include \u003cstdlib.h\u003e","#include \u003ctime.h\u003e","#include \u003ciostream\u003e","#include \u003cvector\u003e","#include \u003calgorithm\u003e","using namespace std;","","void getCombination(vector\u003cint\u003e\u0026 v, int n, int k, vector\u003cint\u003e\u0026 solution, vector\u003c vector\u003cint\u003e \u003e\u0026 result );","vector\u003cvector\u003cint\u003e \u003e combine(vector\u003cint\u003e\u0026 v, int k); ","vector\u003cvector\u003cint\u003e \u003e combine1(vector\u003cint\u003e\u0026 v, int k); ","vector\u003cvector\u003cint\u003e \u003e combine2(vector\u003cint\u003e\u0026 v, int k);","","vector\u003cvector\u003cint\u003e \u003e subsets(vector\u003cint\u003e \u0026S) {"," vector\u003cvector\u003cint\u003e \u003e result;"," for(int i=0; i\u003c=S.size(); i++){"," vector\u003cvector\u003cint\u003e \u003e r = combine(S, i); "," result.insert(result.end(), r.begin(), r.end()); "," } "," return result;","}","","","vector\u003cvector\u003cint\u003e \u003e combine(vector\u003cint\u003e\u0026 v, int k) {"," if (random()%2){"," cout \u003c\u003c \"recusive method!\" \u003c\u003c endl;"," return combine1(v, k);"," }"," cout \u003c\u003c \"non-recusive method!\" \u003c\u003c endl;"," return combine2(v, k);","}","","vector\u003cvector\u003cint\u003e \u003e combine1(vector\u003cint\u003e \u0026v, int k) {"," vector\u003cvector\u003cint\u003e \u003e result;"," vector\u003cint\u003e solution;"," getCombination(v, v.size(), k, solution, result);"," return result;","}","","void getCombination(vector\u003cint\u003e \u0026v, int n, int k, vector\u003cint\u003e\u0026 solution, vector\u003c vector\u003cint\u003e \u003e\u0026 result ){"," if (k==0){"," //sort to meet LeetCode requirement"," vector\u003cint\u003e v = solution;"," sort(v.begin(), v.end());"," result.push_back(v);"," return;"," }"," for(int i=n; i\u003e0; i--){"," solution.push_back(v[i-1]);"," getCombination(v, i-1, k-1, solution, result);"," solution.pop_back();"," }","}","","vector\u003cvector\u003cint\u003e \u003e combine2(vector\u003cint\u003e \u0026v, int k) {"," "," vector\u003cvector\u003cint\u003e \u003e result;"," vector\u003cint\u003e d;"," int n = v.size();"," for (int i=0; i\u003cn; i++){"," d.push_back( (i\u003ck) ? 1 : 0 );"," }",""," //1) from the left, find the [1,0] pattern, change it to [0,1]"," //2) move all of the 1 before the pattern to the most left side"," //3) check all of 1 move to the right"," while(1){"," vector\u003cint\u003e tmp;"," for(int x=0; x\u003cn; x++){"," if (d[x]) tmp.push_back(v[x]);"," }"," sort(tmp.begin(), tmp.end());"," result.push_back(tmp);"," //step 1), find [1,0] pattern"," int i;"," bool found = false;"," int ones =0;"," for(i=0; i\u003cn-1; i++){"," "," if (d[i]==1 \u0026\u0026 d[i+1]==0){"," d[i]=0; d[i+1]=1;"," found = true;"," //step 2) move all of right 1 to the most left side"," for (int j=0; j\u003ci; j++){"," d[j]=( ones \u003e 0 ) ? 1 : 0;"," ones--;"," }"," break; "," } "," if (d[i]==1) ones++;"," }"," if (!found){"," break;"," }"," "," }"," return result;"," ","}","","","","","void printResult(vector\u003cvector\u003cint\u003e \u003e\u0026 result)","{"," for(int i=0; i\u003cresult.size(); i++){"," cout \u003c\u003c \"{\";"," for(int j=0; j\u003cresult[i].size(); j++){"," cout \u003c\u003c \" \" \u003c\u003c result[i][j];"," }"," cout \u003c\u003c \" }\" \u003c\u003cendl;"," }","}","","void printArray(vector\u003cint\u003e\u0026 v){"," cout \u003c\u003c \"{\";"," for(int i=0; i\u003cv.size(); i++) {"," cout \u003c\u003c \" \" \u003c\u003c v[i];"," }"," cout \u003c\u003c \" }\" \u003c\u003c endl;","}","","int main(int argc, char** argv)","{"," srand(time(NULL));",""," int n = 3;"," if (argc\u003e1){"," n = atoi(argv[1]);"," }"," vector\u003cint\u003e v;"," for(int i=n; i\u003e0; i--){"," v.push_back(i);"," }"," printArray(v);"," vector\u003cvector\u003cint\u003e \u003e r = subsets(v);"," printResult(r);","}"],"stylingDirectives":[[[0,53,"pl-c"],[0,2,"pl-c"]],[[0,20,"pl-c"],[0,2,"pl-c"]],[[0,22,"pl-c"],[0,2,"pl-c"]],[],[[0,84,"pl-c"],[0,2,"pl-c"]],[[0,2,"pl-c"]],[[0,67,"pl-c"]],[[0,2,"pl-c"]],[[0,7,"pl-c"]],[[0,2,"pl-c"]],[[0,55,"pl-c"]],[[0,54,"pl-c"]],[[0,2,"pl-c"]],[[0,14,"pl-c"]],[[0,32,"pl-c"]],[[0,2,"pl-c"]],[[0,3,"pl-c"]],[[0,8,"pl-c"]],[[0,8,"pl-c"]],[[0,8,"pl-c"]],[[0,12,"pl-c"]],[[0,10,"pl-c"]],[[0,10,"pl-c"]],[[0,10,"pl-c"]],[[0,6,"pl-c"]],[[0,3,"pl-c"]],[[0,2,"pl-c"]],[[0,16,"pl-c"]],[[0,83,"pl-c"],[81,83,"pl-c"]],[],[[1,8,"pl-k"],[9,18,"pl-s"],[9,10,"pl-pds"],[17,18,"pl-pds"]],[[1,8,"pl-k"],[9,19,"pl-s"],[9,10,"pl-pds"],[18,19,"pl-pds"]],[[1,8,"pl-k"],[9,17,"pl-s"],[9,10,"pl-pds"],[16,17,"pl-pds"]],[[1,8,"pl-k"],[9,19,"pl-s"],[9,10,"pl-pds"],[18,19,"pl-pds"]],[[1,8,"pl-k"],[9,17,"pl-s"],[9,10,"pl-pds"],[16,17,"pl-pds"]],[[1,8,"pl-k"],[9,20,"pl-s"],[9,10,"pl-pds"],[19,20,"pl-pds"]],[[0,5,"pl-k"],[6,15,"pl-k"],[16,19,"pl-en"],[19,20,"pl-k"]],[],[[0,4,"pl-k"],[5,19,"pl-en"],[27,30,"pl-k"],[36,39,"pl-k"],[43,46,"pl-k"],[57,60,"pl-k"],[88,91,"pl-k"]],[[14,17,"pl-k"],[21,28,"pl-en"],[36,39,"pl-k"],[45,48,"pl-k"]],[[14,17,"pl-k"],[21,29,"pl-en"],[37,40,"pl-k"],[46,49,"pl-k"]],[[14,17,"pl-k"],[21,29,"pl-en"],[37,40,"pl-k"],[46,49,"pl-k"]],[],[[14,17,"pl-k"],[21,28,"pl-en"],[36,39,"pl-k"]],[[18,21,"pl-k"]],[[4,7,"pl-k"],[8,11,"pl-k"],[14,15,"pl-c1"],[22,26,"pl-c1"]],[[22,25,"pl-k"],[33,40,"pl-c1"]],[[15,21,"pl-c1"],[29,32,"pl-c1"],[38,43,"pl-c1"],[49,52,"pl-c1"]],[],[[4,10,"pl-k"]],[],[],[],[[14,17,"pl-k"],[21,28,"pl-en"],[36,39,"pl-k"],[45,48,"pl-k"]],[[4,6,"pl-k"],[8,14,"pl-c1"],[17,18,"pl-c1"]],[[16,34,"pl-s"],[16,17,"pl-pds"],[33,34,"pl-pds"]],[[8,14,"pl-k"],[15,23,"pl-c1"]],[],[[12,34,"pl-s"],[12,13,"pl-pds"],[33,34,"pl-pds"]],[[4,10,"pl-k"],[11,19,"pl-c1"]],[],[],[[14,17,"pl-k"],[21,29,"pl-en"],[37,40,"pl-k"],[46,49,"pl-k"]],[[18,21,"pl-k"]],[[11,14,"pl-k"]],[[4,18,"pl-c1"],[24,28,"pl-c1"]],[[4,10,"pl-k"]],[],[],[[0,4,"pl-k"],[5,19,"pl-en"],[27,30,"pl-k"],[36,39,"pl-k"],[43,46,"pl-k"],[57,60,"pl-k"],[88,91,"pl-k"]],[[4,6,"pl-k"],[11,12,"pl-c1"]],[[8,43,"pl-c"],[8,10,"pl-c"]],[[15,18,"pl-k"]],[[8,12,"pl-c1"],[15,20,"pl-c1"],[26,29,"pl-c1"]],[[15,24,"pl-c1"]],[[8,14,"pl-k"]],[],[[4,7,"pl-k"],[8,11,"pl-k"],[19,20,"pl-c1"]],[[17,26,"pl-c1"],[31,32,"pl-c1"]],[[8,22,"pl-c1"],[28,29,"pl-c1"],[33,34,"pl-c1"]],[[17,25,"pl-c1"]],[],[],[],[[14,17,"pl-k"],[21,29,"pl-en"],[37,40,"pl-k"],[46,49,"pl-k"]],[],[[18,21,"pl-k"]],[[11,14,"pl-k"]],[[4,7,"pl-k"],[14,18,"pl-c1"]],[[4,7,"pl-k"],[9,12,"pl-k"],[15,16,"pl-c1"]],[[10,19,"pl-c1"],[29,30,"pl-c1"],[33,34,"pl-c1"]],[],[],[[4,66,"pl-c"],[4,6,"pl-c"]],[[4,67,"pl-c"],[4,6,"pl-c"]],[[4,41,"pl-c"],[4,6,"pl-c"]],[[4,9,"pl-k"],[10,11,"pl-c1"]],[[15,18,"pl-k"]],[[8,11,"pl-k"],[12,15,"pl-k"],[18,19,"pl-c1"]],[[12,14,"pl-k"],[26,35,"pl-c1"]],[],[[8,12,"pl-c1"],[17,22,"pl-c1"],[30,33,"pl-c1"]],[[15,24,"pl-c1"]],[[8,37,"pl-c"],[8,10,"pl-c"]],[[8,11,"pl-k"]],[[8,12,"pl-k"],[21,26,"pl-c1"]],[[8,11,"pl-k"],[18,19,"pl-c1"]],[[8,11,"pl-k"],[14,15,"pl-c1"],[21,22,"pl-c1"]],[],[[12,14,"pl-k"],[22,23,"pl-c1"],[31,32,"pl-c1"],[35,36,"pl-c1"]],[[21,22,"pl-c1"],[28,29,"pl-c1"],[31,32,"pl-c1"]],[[24,28,"pl-c1"]],[[16,67,"pl-c"],[16,18,"pl-c"]],[[16,19,"pl-k"],[21,24,"pl-k"],[27,28,"pl-c1"]],[[34,35,"pl-c1"],[40,41,"pl-c1"],[44,45,"pl-c1"]],[],[],[[16,21,"pl-k"]],[],[[12,14,"pl-k"],[22,23,"pl-c1"]],[],[[8,10,"pl-k"]],[[12,17,"pl-k"]],[],[],[],[[4,10,"pl-k"]],[],[],[],[],[],[],[[0,4,"pl-k"],[5,16,"pl-en"],[31,34,"pl-k"]],[],[[4,7,"pl-k"],[8,11,"pl-k"],[14,15,"pl-c1"],[26,30,"pl-c1"]],[[16,19,"pl-s"],[16,17,"pl-pds"],[18,19,"pl-pds"]],[[8,11,"pl-k"],[12,15,"pl-k"],[18,19,"pl-c1"],[33,37,"pl-c1"]],[[20,23,"pl-s"],[20,21,"pl-pds"],[22,23,"pl-pds"]],[],[[16,20,"pl-s"],[16,17,"pl-pds"],[19,20,"pl-pds"]],[],[],[],[[0,4,"pl-k"],[5,15,"pl-en"],[23,26,"pl-k"]],[[12,15,"pl-s"],[12,13,"pl-pds"],[14,15,"pl-pds"]],[[4,7,"pl-k"],[8,11,"pl-k"],[14,15,"pl-c1"],[21,25,"pl-c1"]],[[16,19,"pl-s"],[16,17,"pl-pds"],[18,19,"pl-pds"]],[],[[12,16,"pl-s"],[12,13,"pl-pds"],[15,16,"pl-pds"]],[],[],[[0,3,"pl-k"],[4,8,"pl-en"],[9,12,"pl-k"],[19,23,"pl-k"]],[],[[4,9,"pl-c1"],[10,14,"pl-c1"],[15,19,"pl-c1"]],[],[[4,7,"pl-k"],[12,13,"pl-c1"]],[[4,6,"pl-k"],[13,14,"pl-c1"]],[[12,16,"pl-c1"],[22,23,"pl-c1"]],[],[[11,14,"pl-k"]],[[4,7,"pl-k"],[8,11,"pl-k"],[19,20,"pl-c1"]],[[10,19,"pl-c1"]],[],[[4,14,"pl-c1"]],[[18,21,"pl-k"],[29,36,"pl-c1"]],[[4,15,"pl-c1"]],[]],"colorizedLines":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/wwh51/leetcode/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null},"displayName":"subsets.cpp","displayUrl":"https://github.com/wwh51/leetcode/blob/master/src/subsets/subsets.cpp?raw=true","headerInfo":{"blobSize":"3.94 KB","deleteTooltip":"You must be signed in to make or propose changes","editTooltip":"You must be signed in to make or propose changes","ghDesktopPath":"https://desktop.github.com","isGitLfs":false,"onBranch":true,"shortPath":"f7f0121","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Fwwh51%2Fleetcode%2Fblob%2Fmaster%2Fsrc%2Fsubsets%2Fsubsets.cpp","isCSV":false,"isRichtext":false,"toc":null,"lineInfo":{"truncatedLoc":"168","truncatedSloc":"147"},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplate":null,"discussionTemplate":null,"language":"C++","languageID":43,"large":false,"planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/wwh51/leetcode/blob/master/src/subsets/subsets.cpp","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","releasePath":"/wwh51/leetcode/releases/new?marketplace=true","showPublishActionBanner":false},"rawBlobUrl":"https://github.com/wwh51/leetcode/raw/refs/heads/master/src/subsets/subsets.cpp","renderImageOrRaw":false,"richText":null,"renderedFileInfo":null,"shortPath":null,"symbolsEnabled":true,"tabSize":8,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","actionsOnboardingTip":null},"truncated":false,"viewable":true,"workflowRedirectUrl":null,"symbols":null},"copilotInfo":null,"copilotAccessAllowed":false,"modelsAccessAllowed":false,"modelsRepoIntegrationEnabled":false,"csrf_tokens":{"/wwh51/leetcode/branches":{"post":"ooRzq8gK1ZhlT1m4AK5tca7mQgKa5x_UQ-CxP-F0uRSrw1uzCIF2bDSsGsSyYMUpkw-WQppfrLLViQ2uoQKIyw"},"/repos/preferences":{"post":"bdkS5Qwjfs9jOJyBmWxGcxIgbFXwOxXrdtADDMwn8xO61QEoisKbRZlK5Kt1oSsuvC1CANcPuEhQtPj7KbP5AA"}}},"title":"leetcode/src/subsets/subsets.cpp at master · wwh51/leetcode","appPayload":{"helpUrl":"https://docs.github.com","findFileWorkerPath":"/assets-cdn/worker/find-file-worker-263cab1760dd.js","findInFileWorkerPath":"/assets-cdn/worker/find-in-file-worker-1b17b3e7786a.js","githubDevUrl":null,"enabled_features":{"code_nav_ui_events":false,"react_blob_overlay":false,"accessible_code_button":true}}}
0