{"id":1590,"date":"2023-06-19T18:07:57","date_gmt":"2023-06-19T10:07:57","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=1590"},"modified":"2023-06-19T18:07:57","modified_gmt":"2023-06-19T10:07:57","slug":"%e3%80%90%e7%ae%97%e6%b3%95%e9%a2%98%e8%a7%a3%e3%80%9128-%e5%ad%90%e9%9b%86%e7%9a%84%e9%80%92%e5%bd%92%e8%a7%a3%e6%b3%95","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/%e7%ae%97%e6%b3%95\/%e3%80%90%e7%ae%97%e6%b3%95%e9%a2%98%e8%a7%a3%e3%80%9128-%e5%ad%90%e9%9b%86%e7%9a%84%e9%80%92%e5%bd%92%e8%a7%a3%e6%b3%95\/","title":{"rendered":"\u3010\u7b97\u6cd5\u9898\u89e3\u301128. \u5b50\u96c6\u7684\u9012\u5f52\u89e3\u6cd5"},"content":{"rendered":"<div class='wxsyncmain'>\n<section data-tool=\"mdnice\u7f16\u8f91\u5668\" data-website=\"https:\/\/www.mdnice.com\" style=\"font-size: 16px;padding-right: 10px;padding-left: 10px;word-break: break-word;text-align: left;line-height: 1.25;color: rgb(43, 43, 43);letter-spacing: 2px;background-image: linear-gradient(90deg, rgba(50, 0, 0, 0.04) 3%, rgba(0, 0, 0, 0) 3%), linear-gradient(360deg, rgba(50, 0, 0, 0.04) 3%, rgba(0, 0, 0, 0) 3%);background-size: 20px 20px;background-position: center center;font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, &quot;PingFang SC&quot;, Cambria, Cochin, Georgia, Times, &quot;Times New Roman&quot;, serif;\" data-mpa-powered-by=\"yiban.io\">\n<blockquote data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-size: 0.9em;overflow: auto;padding: 10px 10px 10px 20px;margin-bottom: 20px;margin-top: 20px;text-size-adjust: 100%;line-height: 1.55em;border-radius: 6px;color: rgb(89, 89, 89);box-sizing: inherit;border-width: 1px;border-top-style: solid;border-right-style: solid;border-bottom-style: solid;border-color: rgba(64, 184, 250, 0.4);background: rgba(64, 184, 250, 0.1);\"><p><span style=\"color: RGBA(64, 184, 250, .5);font-size: 34px;line-height: 1;font-weight: 700;\">\u275d<\/span><\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;font-size: 14px;word-spacing: 2px;line-height: 26px;\">\u8fd9\u662f\u4e00\u9053 <strong style=\"color: rgb(53, 148, 247);\">\u300c\u4e2d\u7b49\u96be\u5ea6\u300d<\/strong> \u7684\u9898<br  \/>\u9898\u76ee\u6765\u81ea\uff1ahttps:\/\/leetcode.cn\/problems\/subsets\/<\/p>\n<p><span style=\"float: right;color: RGBA(64, 184, 250, .5);\">\u275e<\/span><\/p><\/blockquote>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;color: black;font-size: 22px;border-bottom: 4px solid rgb(64, 184, 250);\"><span style=\"display: flex;width: 20px;height: 20px;background-size: 20px 20px;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528043816321.png');margin-bottom: -22px;\"><\/span><span style=\"display: flex;color: #40B8FA;font-size: 20px;margin-left: 25px;\">\u9898\u76ee<\/span><span style=\"display: flex;width: 200px;height: 10px;border-top-left-radius: 20px;background: rgba(64, 184, 250, 0.5);color: rgb(255, 255, 255);font-size: 16px;letter-spacing: 0.544px;justify-content: flex-end;float: right;margin-top: -10px;\"><\/span><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u7ed9\u4f60\u4e00\u4e2a\u6574\u6570\u6570\u7ec4 <code style=\"margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(53, 148, 247);background: rgba(59, 170, 250, 0.1);padding-right: 2px;padding-left: 2px;border-radius: 2px;height: 21px;line-height: 22px;\">nums<\/code> \uff0c\u6570\u7ec4\u4e2d\u7684\u5143\u7d20 <strong style=\"color: rgb(53, 148, 247);\">\u300c\u4e92\u4e0d\u76f8\u540c\u300d<\/strong> \u3002\u8fd4\u56de\u8be5\u6570\u7ec4\u6240\u6709\u53ef\u80fd\u7684\u5b50\u96c6\uff08\u5e42\u96c6\uff09\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u89e3\u96c6 <strong style=\"color: rgb(53, 148, 247);\">\u300c\u4e0d\u80fd\u300d<\/strong> \u5305\u542b\u91cd\u590d\u7684\u5b50\u96c6\u3002\u4f60\u53ef\u4ee5\u6309 <strong style=\"color: rgb(53, 148, 247);\">\u300c\u4efb\u610f\u987a\u5e8f\u300d<\/strong> \u8fd4\u56de\u89e3\u96c6\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\"><strong>\u793a\u4f8b 1\uff1a<\/strong><\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background: url(&quot;https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528043824125.jpeg&quot;) 10px 10px \/ 40px no-repeat rgb(40, 44, 52);height: 30px;width: 100%;margin-bottom: -7px;border-radius: 5px;\"><\/span><code style=\"overflow-x: auto;padding: 16px;color: #abb2bf;display: -webkit-box;font-family: Operator Mono, Consolas, Monaco, Menlo, monospace;font-size: 12px;-webkit-overflow-scrolling: touch;letter-spacing: 0px;padding-top: 15px;background: #282c34;border-radius: 5px;\"><span style=\"color: #c678dd;line-height: 26px;\">var<\/span>&nbsp;ans&nbsp;[][]<span style=\"color: #c678dd;line-height: 26px;\">int<\/span><br  \/><span style=\"color: #c678dd;line-height: 26px;\">var<\/span>&nbsp;subSet&nbsp;[]<span style=\"color: #c678dd;line-height: 26px;\">int<\/span><br  \/><br  \/><span style=\"line-height: 26px;\"><span style=\"color: #c678dd;line-height: 26px;\">func<\/span>&nbsp;<span style=\"color: #61aeee;line-height: 26px;\">subsets<\/span><span style=\"line-height: 26px;\">(nums&nbsp;[]<span style=\"color: #c678dd;line-height: 26px;\">int<\/span>)<\/span>&nbsp;[][]<span style=\"color: #61aeee;line-height: 26px;\">int<\/span><\/span>&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;subSet&nbsp;=&nbsp;[]<span style=\"color: #c678dd;line-height: 26px;\">int<\/span>{}<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;ans&nbsp;=&nbsp;[][]<span style=\"color: #c678dd;line-height: 26px;\">int<\/span>{}<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;recursion(<span style=\"color: #d19a66;line-height: 26px;\">0<\/span>,&nbsp;nums)<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">return<\/span>&nbsp;ans<br  \/>}<br  \/><br  \/><span style=\"line-height: 26px;\"><span style=\"color: #c678dd;line-height: 26px;\">func<\/span>&nbsp;<span style=\"color: #61aeee;line-height: 26px;\">recursion<\/span><span style=\"line-height: 26px;\">(i&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">int<\/span>,&nbsp;nums&nbsp;[]<span style=\"color: #c678dd;line-height: 26px;\">int<\/span>)<\/span><\/span>&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">if<\/span>&nbsp;i&nbsp;==&nbsp;<span style=\"color: #e6c07b;line-height: 26px;\">len<\/span>(nums)&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;temp&nbsp;:=&nbsp;<span style=\"color: #e6c07b;line-height: 26px;\">make<\/span>([]<span style=\"color: #c678dd;line-height: 26px;\">int<\/span>,&nbsp;<span style=\"color: #e6c07b;line-height: 26px;\">len<\/span>(subSet))<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #e6c07b;line-height: 26px;\">copy<\/span>(temp,&nbsp;subSet)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ans&nbsp;=&nbsp;<span style=\"color: #e6c07b;line-height: 26px;\">append<\/span>(ans,&nbsp;temp)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #c678dd;line-height: 26px;\">return<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #5c6370;font-style: italic;line-height: 26px;\">\/\/&nbsp;\u4e0d\u9009<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;recursion(i&nbsp;+&nbsp;<span style=\"color: #d19a66;line-height: 26px;\">1<\/span>,&nbsp;nums)<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #5c6370;font-style: italic;line-height: 26px;\">\/\/&nbsp;\u9009<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;subSet&nbsp;=&nbsp;<span style=\"color: #e6c07b;line-height: 26px;\">append<\/span>(subSet,&nbsp;nums[i])<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;recursion(i&nbsp;+&nbsp;<span style=\"color: #d19a66;line-height: 26px;\">1<\/span>,&nbsp;nums)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;subSet&nbsp;=&nbsp;subSet[:<span style=\"color: #e6c07b;line-height: 26px;\">len<\/span>(subSet)&nbsp;-&nbsp;<span style=\"color: #d19a66;line-height: 26px;\">1<\/span>]<br  \/>}<\/code><\/pre>\n<section data-mpa-template=\"t\" mpa-from-tpl=\"t\">\n<p style=\"padding-right: 0em;padding-left: 0em;clear: both;min-height: 1em;color: rgb(62, 62, 62);font-size: 16px;list-style-type: none;-webkit-padding-start: 0px;-webkit-margin-before: 0px;-webkit-margin-after: 0px;line-height: 25.6px;text-align: center;margin-left: 8px;margin-right: 8px;\"><span style=\"margin: 0px;padding: 0px;font-size: 14px;\"><br data-filtered=\"filtered\" style=\"margin: 0px;padding: 0px;\" mpa-from-tpl=\"t\"  \/><\/span><\/p>\n<p style=\"padding-right: 0em;padding-left: 0em;clear: both;min-height: 1em;color: rgb(62, 62, 62);font-size: 16px;list-style-type: none;-webkit-padding-start: 0px;-webkit-margin-before: 0px;-webkit-margin-after: 0px;line-height: 25.6px;text-align: center;margin-left: 8px;margin-right: 8px;\"><span style=\"margin: 0px;padding: 0px;font-size: 14px;\">- End -<\/span><\/p>\n<\/section>\n<p><br mpa-from-tpl=\"t\"  \/><\/p>\n<section class=\"mp_profile_iframe_wrp\"><mp-common-profile class=\"js_uneditable custom_select_card mp_profile_iframe\" data-pluginname=\"mpprofile\" data-weui-theme=\"light\" data-id=\"MzU1OTYwMjk1OQ==\" data-headimg=\"http:\/\/mmbiz.qpic.cn\/mmbiz_png\/JvpD6fdLxcC9CibUnKaozZdY5gkBVksO6mudaAv9SCIzDScFq1VQtbF7TPwA8eqlftZTbVm4OIxXBPGyXsTN1xA\/0?wx_fmt=png\" data-nickname=\"i\u4f59\u6570\" data-alias=\"iyushu888\" data-signature=\"\u8bb0\u5f55\u4e0e\u5206\u4eab \u300cJava &amp; Go &amp; \u7b97\u6cd5 \u300d\u5b66\u4e60\u7b14\u8bb0\u3002\" data-from=\"0\" data-is_biz_ban=\"0\"><\/mp-common-profile><\/section>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\"><br mpa-from-tpl=\"t\"  \/><\/p>\n<section data-mpa-template=\"t\" mpa-from-tpl=\"t\">\n<section style=\"display: flex;flex-direction: column;padding: 0 19px 0 0;\" data-mid=\"\" mpa-from-tpl=\"t\">\n<section style=\"display: flex;flex-direction: column;align-self: flex-end;\" data-mid=\"\" mpa-from-tpl=\"t\">\n<section style=\"display: flex;align-self: flex-end;\" data-mid=\"\" mpa-from-tpl=\"t\">\n<section style=\"width: 15px;height: 17px;display: flex;justify-content: center;align-items: center;flex-shrink: 0;\" data-mid=\"\" mpa-from-tpl=\"t\"><img decoding=\"async\" class=\"lazyload\"data-ratio=\"1.1333333333333333\"  data-w=\"30\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528043823563.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" data-ratio=\"1.1333333333333333\"  data-w=\"30\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528043823563.png\"  \/><\/noscript><\/section>\n<section style=\"text-align: left;padding: 0 0 0 6px;\" data-mid=\"\" mpa-from-tpl=\"t\">\n<p style=\"font-size: 16px;font-family: PingFangSC-Regular, PingFang SC;color: #333333;line-height: 22px;word-break: break-word;\" data-mid=\"\">\u70b9\u4e2a<span style=\"font-weight: bold;padding: 0 5px;\" data-mid=\"\">\u5728\u770b<\/span>\u4f60\u6700\u597d\u770b<\/p>\n<\/section>\n<\/section>\n<section style=\"text-align: left;\" data-mid=\"\" mpa-from-tpl=\"t\">\n<p style=\"font-size: 12px;font-family: PingFangSC-Semibold, PingFang SC;font-weight: bold;color: rgba(51, 51, 51, 0.15);line-height: 17px;word-break: break-word;\" data-mid=\"\">CLICK TO SEE YOU LOOK THE BEST<\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p><br  \/><\/p>\n<\/section>\n<p style=\"display: none;\"><mp-style-type data-value=\"3\"><\/mp-style-type><\/p>\n<blockquote>\n<p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7:                 i\u4f59\u6570              <\/p>\n<\/blockquote>\n<\/div>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>\u275d \u8fd9\u662f\u4e00\u9053 \u300c\u4e2d\u7b49\u96be\u5ea6\u300d \u7684\u9898\u9898\u76ee\u6765\u81ea\uff1ahttps:\/\/leetcode.cn\/problems\/subsets\/ \u275e \u9898\u76ee \u7ed9 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":1585,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[22],"tags":[],"class_list":["post-1590","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-22"],"post_thumbnail_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528043817959-150x150.jpeg","content_first_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528043823563.png","post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528043817959-300x128.jpeg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528043817959.jpeg","post_frist_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528043823563.png","post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528043817959-300x128.jpeg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528043817959.jpeg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528043817959.jpeg","post_all_images":[{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528043823563.png","id":"image0"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528043823563.png","id":"image1"}],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"\u7b97\u6cd5","post_date":"2023-06-19","like_count":"0","praiseWord":"\u9f13\u52b1","copyright_state":"","excitationAd":"0","rewardedVideoAdId":"","detailAdId":"","detailAd":"0","enterpriseMinapp":"0","audios":[],"postImageUrl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230519082947553.jpg","avatarurls":[],"related_posts":null,"pageviews":279,"next_post_id":1414,"next_post_title":"\u3010\u7b97\u6cd5\u9898\u89e3\u301123. \u6ed1\u52a8\u7a97\u53e3\u6700\u5927\u503c \u2014\u2014 \u5355\u8c03\u961f\u5217\u89e3\u6cd5","previous_post_id":1601,"previous_post_title":"\u3010\u7b97\u6cd5\u9898\u89e3\u301130. \u5168\u6392\u5217\u7684\u9012\u5f52\u89e3\u6cd5","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/1590","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1590"}],"version-history":[{"count":0,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/1590\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/1585"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1590"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1590"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1590"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}