{"version":"1.0","provider_name":"Hatena Blog","published":"2011-05-21 00:00:00","description":"Problem 5\u3053\u306e\u554f\u984c\u306f\u6700\u5c0f\u516c\u500d\u6570\u3092\u6c42\u3081\u308b\u3060\u3051\u3067\u3059\u304c\u3001Int\u306e\u7bc4\u56f2\u3067\u53ce\u3081\u3088\u3046\u3068\u3059\u308b\u3068\u3061\u3087\u3063\u3068\u3060\u3051\u5de5\u592b\u304c\u5fc5\u8981\u3067\u3059\u3002 reduce\u7cfb\u30e1\u30bd\u30c3\u30c9 \u6700\u5c0f\u516c\u500d\u6570\u3092\u6b21\u3005\u3068\u6c42\u3081\u308b\u306b\u306freduceLeft\u3092\u4f7f\u3044\u307e\u3059\u3002\u3053\u308c\u306fPython\u306ereduce\u3068\u3060\u3044\u305f\u3044\u540c\u3058\u3067\u3059\u3002\u9055\u3046\u3068\u3053\u308d\u306f\u521d\u671f\u5024\u304c\u53d6\u308c\u306a\u3044\u3068\u3053\u308d\u304f\u3089\u3044\u3067\u3057\u3087\u3046\u304b\u3002\u7c21\u5358\u306a\u4f8b\u306f\u548c\u3092\u53d6\u308b\u51e6\u7406\u3067\u3059\u3002 println ((1 to 4).reduceLeft(_ + _)) // 10 reduceRight\u3082\u3042\u308a\u307e\u3059\u3002 println ((1 to 4).reduceRight(_ + _)) // 10 \u7d50\u679c\u306f\u540c\u3058\u3067\u3059\u304c\u3001\u51e6\u7406\u304c\u9055\u3044\u307e\u3059\u3002reduceLeft\u2026","blog_url":"https://inamori.hateblo.jp/","type":"rich","provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/inamori/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Finamori.hateblo.jp%2Fentry%2F20110521%2Fp1\" title=\"Scala\u3067Project Euler\uff0812\uff09 - inamori\u2019s diary\" 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%","blog_title":"inamori\u2019s diary","image_url":null,"url":"https://inamori.hateblo.jp/entry/20110521/p1","title":"Scala\u3067Project Euler\uff0812\uff09","categories":["Scala"],"author_name":"inamori","height":"190"}