{"author_url":"https://blog.hatena.ne.jp/redcat_prog/","width":"100%","provider_url":"https://hatena.blog","type":"rich","blog_url":"https://redcat-prog.hatenadiary.org/","categories":["Ruby"],"height":"190","title":"\u914d\u5217\u3092\u96c6\u5408\u306b\u898b\u7acb\u3066\u3066\u3079\u304d\u96c6\u5408\u3092\u751f\u6210\u3059\u308b(Ruby \u7248)","description":"\u914d\u5217(Array \u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9) set \u304c\u3042\u308b\u3068\u3057\u3066 powerset = Array.new (0..2 ** set.size - 1).each do |n| subset = Array.new set.each do |i| subset << i if n & 1 == 1 n >>= 1 end powerset << subset end \u3084\u3063\u3071\u308a Ruby \u3044\u3044\u3067\u3059\u306d ! (\u30b9\u30c6\u30de)","published":"2012-08-01 01:40:01","author_name":"redcat_prog","url":"https://redcat-prog.hatenadiary.org/entry/20120801/1343752801","image_url":null,"version":"1.0","provider_name":"Hatena Blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fredcat-prog.hatenadiary.org%2Fentry%2F20120801%2F1343752801\" title=\"\u914d\u5217\u3092\u96c6\u5408\u306b\u898b\u7acb\u3066\u3066\u3079\u304d\u96c6\u5408\u3092\u751f\u6210\u3059\u308b(Ruby \u7248) - \u4f3c\u975e\u30d7\u30ed\u30b0\u30e9\u30de\u306e\u899a\u3048\u66f8\u304d\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_title":"\u4f3c\u975e\u30d7\u30ed\u30b0\u30e9\u30de\u306e\u899a\u3048\u66f8\u304d"}