{"categories":["ruby"],"height":"190","provider_url":"https://hatena.blog","description":"\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30cf\u30c3\u30b7\u30e5\u3092\u4f5c\u308b\u3053\u3068\u3067\u3001pascal\u306e3\u89d2\u5f62\u306e\u5024\u304c\u8a08\u7b97\u3067\u304d\u308b\u3002 pascal = Hash.new do |h,n| if n <= 1 h[n] = [1] else h[n] = [0,*h[n-1]].zip([h[n-1],0].flatten).map{ |x,y| x + y} end end #require 'benchmark' #Benchmark.bmbm do |x| # n = 100 # x.report(\"hash\"){n.times{ |i| pascal[i]} } #end # >> Rehearsal ----------------------\u2026","blog_url":"https://trotr.hatenadiary.org/","author_url":"https://blog.hatena.ne.jp/trotr/","provider_name":"Hatena Blog","published":"2008-05-23 00:24:52","blog_title":"trotr\u306e\u65e5\u8a18","image_url":null,"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftrotr.hatenadiary.org%2Fentry%2F20080523%2F1211556292\" title=\"\u5358\u7d14\u306a\u30e1\u30e2\u5316\u306a\u3089hash\u3092\u4f7f\u3063\u3066\u3082\u3044\u3044\u306e\u304b\u3082\u3057\u308c\u306a\u3044 - trotr\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","width":"100%","version":"1.0","type":"rich","title":"\u5358\u7d14\u306a\u30e1\u30e2\u5316\u306a\u3089hash\u3092\u4f7f\u3063\u3066\u3082\u3044\u3044\u306e\u304b\u3082\u3057\u308c\u306a\u3044","author_name":"trotr","url":"https://trotr.hatenadiary.org/entry/20080523/1211556292"}