알고리즘 공부
2020. 8. 20. 22:40
https://leetcode.com/problems/subsets/
/**
* @param {number[]} nums
* @return {number[][]}
*/
var subsets = function(nums) {
var res=[];
var length = nums.length;
var find = function( p_idx, p_arr )
{
if( p_idx >= length )
{
res.push(p_arr);
}
else
{
find( p_idx+1, p_arr.concat( nums[p_idx] ) );
find( p_idx+1, p_arr );
}
return ;
}
find(0,[]);
return res;
};