Given a set of distinct integers, S, return all possible subsets.
Note:
For example,
If S = [1,2,3]
,
a solution is:
[ [3], [1], [2], [1,2,3], [1,3], [2,3], [1,2], [] ]Show Tags
×Ó¼¯ºÏ£¬»¹ÊÇͨ¹ý»ØËݵķ½·¨À´Çó½â¡£¸ú֮ǰk¸öÔªËصÄ×Ô¼º²»Ò»ÑùµÄÊÇÕâÀïÈÎÒâ¸ö×ÓÔªËض¼¿ÉÒÔ×÷Ϊ×Ó¼¯ºÏ¡£Òò´ËÓÐ×Ó¼¯ºÏµÄʱºòÎÒÃǶ¼Ï£ÍûÄܹ»Ìí¼Óµ½solutionÖУ¬¿ÉÒÔͨ¹ý¿Õµü´úµÄ·½Ê½Ìí¼Ó¡£»¹ÓоÍÊÇÏÈÌí¼ÓÒ»¸öÔªËØ£¬À´µ÷ÓÃsubº¯Êý£¬È»ºó»ØËÝ£¬¾ÍÊǰѸÕÌí¼ÓµÄÔªËØÈ¥³ý¡£ÒòΪÔÚµ÷ÓÃsubµÄ¹ý³ÌÖл¹ÓзÖÖ§µÄ¹ý³Ì£¬ÕâÊÇ×ã¹»µÄ¡£
<†·Ÿ"http://www.Bkjia.com/kf/ware/vc/" target="_blank" class="keylink">vcD4KPHByZSBjbGFzcz0="brush:java;">class Solution {
public:
void sub(vector