{"id":6504,"date":"2022-10-25T20:19:45","date_gmt":"2022-10-25T11:19:45","guid":{"rendered":"https:\/\/suzutukiblog.com\/?p=6504"},"modified":"2022-10-28T20:48:10","modified_gmt":"2022-10-28T11:48:10","slug":"tips-16","status":"publish","type":"post","link":"https:\/\/suzutukiblog.com\/index.php\/2022\/10\/25\/tips-16\/","title":{"rendered":"TIPS(Ruby:\u914d\u5217\u3092\u964d\u9806\u306b\u3059\u308b\u30fb1\u306e\u4f4d\u3092\u53d6\u5f97\u3059\u308b)"},"content":{"rendered":"<h3>\u554f\u984c<\/h3>\n<p>Ruby\u3067\u914d\u5217\u3092\u964d\u9806\u306b\u3059\u308b\u306b\u306f\uff1f<\/p>\n<pre>#\u964d\u9806\u306b\u3059\u308b\r\n\r\na = [0,9,4,5]\r\n\r\na = a.sort_by { |n| n }.reverse<\/pre>\n<h1>#\u5b9f\u884c\u7d50\u679c<\/h1>\n<p><code class=\"stdout ng-binding\">[9, 5, 4, 0]<\/code><\/p>\n<h3>\u554f\u984c<\/h3>\n<p>Ruby\u3067\u914d\u5217\u306e\u4e2d\u3067\u52a0\u7b97\u3057\u306a\u304c\u30891\u306e\u4f4d\u3092\u53d6\u5f97\u3059\u308b<\/p>\n<h2>\u5165\u529b\u5024<\/h2>\n<pre>62 89<\/pre>\n<h2>\u671f\u5f85\u3059\u308b\u51fa\u529b<\/h2>\n<pre>8\r\n7<\/pre>\n<h2>\u30b3\u30fc\u30c9\u3068\u89e3\u8aac (\u5165\u529b\u4f8b1\u3067\u89e3\u8aac)<\/h2>\n<pre>#1\u884c\u76ee\u306e\u534a\u89d2\u30b9\u30da\u30fc\u30b9\u523b\u307f\u306e\u5165\u529b\u5024\u3092\u6587\u5b57\u5217\u3068\u3057\u3066\u5404\u5909\u6570\u306b\u4ee3\u5165\r\nn, m = gets.split\r\n\r\n#n = [\"62\"] \u2192 [\"6\",\"2\"]\u2192 [6,2]\u2192 [8] \u2192 [8] \u2192 8 \r\nn.chars.map(&amp;:to_i).sum.digits.take(1).pop\r\n\r\n#m = [\"89\"] \u2192 [\"8\",\"9\"]\u2192 [8,9]\u2192 [17] \u2192 [7] \u2192 7 \r\nm.chars.map(&amp;:to_i).sum.digits.take(1).pop<\/pre>\n<h2>1:.chars\u3067\u6587\u5b57\u5217\u3092\u30d0\u30e9\u30d0\u30e9\u306b\u3059\u308b[&#8217;89&#8217;] \u2192 [&#8216;8&#8242;,&#8217;9&#8217;]<br \/>\n2:.map(&amp;:to_i)\u3067\u6587\u5b57\u5217\u3092\u6570\u5b57\u306b\u5909\u3048\u308b[&#8216;8&#8242;,&#8217;9&#8217;]\u2192 [8,9]<br \/>\n3:.sum\u3067\u914d\u5217\u306e\u4e2d\u8eab\u306e\u6570\u5b57\u3092\u5408\u8a08\u3059\u308b[8,9]\u2192[17]<br \/>\n4:.digits.take(1)\u30671\u306e\u4f4d\u3092\u53d6\u308a\u51fa\u3059[17]\u2192[7]<br \/>\n5:.pop\u3067\u914d\u5217\u304b\u3089\u53d6\u308a\u51fa\u3059[7] \u2192 7<\/h2>\n<h2>\u554f\u984c<\/h2>\n<p>\u914d\u5217\u5185\u306e\u6570\u5b57\u304c\u7d9a\u3044\u3066\u3044\u308b\u6642\u30b0\u30eb\u30fc\u30d7\u5316\u3057\u3066\u6700\u5c0f\u3092\u8db3\u3057\u5408\u308f\u305b\u308b<\/p>\n<p><strong>8 10 11 12 21 22\u306e\u5834\u5408<\/strong><\/p>\n<p><strong>[[8], [10, 11, 12], [21, 22]]<\/strong>\u2190\u3053\u306e\u3088\u3046\u306b\u3057\u3066\u5404\u914d\u5217\u306e\u6700\u5c0f\u306e\u5024\u3092\u8db3\u3057\u5408\u308f\u305b\u308b<\/p>\n<h2>\u5165\u529b\u5024<\/h2>\n<pre>6 \r\n8 10 11 12 21 22<\/pre>\n<h2>\u671f\u5f85\u3059\u308b\u51fa\u529b<\/h2>\n<pre>39<\/pre>\n<h1>\u30b3\u30fc\u30c9\u3068\u89e3\u8aac .chunk_while\u3092\u4f7f\u3048\u3070\u697d\u306b\u3067\u304d\u308b<\/h1>\n<pre>#\u7a7a\u306e\u914d\u5217\u3067\u521d\u671f\u5316\u3059\u308b\r\nanswer = []\r\n\r\n#1\u884c\u76ee\u306e\u5165\u529b\u5024(\u6570\u5024)\u3092\u5909\u6570\u306b\u4ee3\u5165\u3059\u308b\r\nn = gets.to_i\r\n\r\n#2\u884c\u76ee\u306e\u534a\u89d2\u30b9\u30da\u30fc\u30b9\u523b\u307f\u306e\u5165\u529b\u5024\u3092\u914d\u5217\u306b\u4ee3\u5165\u3057\u3066\u304b\u3089\u6607\u9806\u306b\u4e26\u3073\u66ff\u3048\u308b\r\na = gets.split.map(&amp;:to_i).sort\r\n\r\ngroup = a.chunk_while {|i, j| i + 1 == j }.to_a\r\n\r\n#\u914d\u5217\u306e\u9577\u3055\u3067\u7e70\u308a\u8fd4\u3059\r\ngroup.size.times do |i|\r\n  #\u5404\u914d\u5217\u306e\u6700\u5c0f\u5024\u3092\u914d\u5217\u306b\u633f\u5165\u3059\u308b\r\n  answer &lt;&lt; group[i].min\r\nend\r\nputs answer.sum<\/pre>\n<h2>\u203b\u30dd\u30a4\u30f3\u30c8<\/h2>\n<pre>group = a.chunk_while {|i, j| i + 1 == j }.to_a\r\n<code class=\"stdout ng-binding\">#\u5b9f\u884c\u7d50\u679c[[8], [10, 11, 12], [21, 22]]<\/code><\/pre>\n<h2>\u3042\u3068\u306f\u5404\u914d\u5217\u306e\u6700\u5c0f\u5024\u3092.min\u3067\u53d6\u308a\u51fa\u3057\u3066\u914d\u5217\u306b\u633f\u5165\u3057\u3066\u3044\u304d<br \/>\n\u6700\u7d42\u7684\u306b\u914d\u5217answer\u3092.sum\u3067\u7dcf\u548c\u3092\u51fa\u3059\u3053\u3068\u3067\u3067\u304d\u308b\u3002<\/h2>\n","protected":false},"excerpt":{"rendered":"<p>\u554f\u984c Ruby\u3067\u914d\u5217\u3092\u964d\u9806\u306b\u3059\u308b\u306b\u306f\uff1f #\u964d\u9806\u306b\u3059\u308b a = [0,9,4,5] a = a.sort_by { |n| n }.reverse #\u5b9f\u884c\u7d50\u679c [9, 5, 4, 0] \u554f\u984c Ruby\u3067\u914d\u5217\u306e\u4e2d\u3067\u52a0\u7b97\u3057\u306a\u304c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[27],"tags":[],"class_list":["post-6504","post","type-post","status-publish","format-standard","hentry","category-programming-note"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.8 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u554f\u984c Ruby\u3067\u914d\u5217\u3092\u964d\u9806\u306b\u3059\u308b\u306b\u306f\uff1f #\u964d\u9806\u306b\u3059\u308b a = [0,9,4,5] a = a.sort_by\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"\u30aa\u30aa\u30bf\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/suzutukiblog.com\/index.php\/2022\/10\/25\/tips-16\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.8\" \/>\n\t\t<meta property=\"og:locale\" content=\"ja_JP\" \/>\n\t\t<meta property=\"og:site_name\" content=\"\u3068\u3042\u308bIT\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u30d6\u30ed\u30b0 \u2014 \u6bce\u65e5\u5c11\u3057\u305a\u3064\u6210\u9577\u3059\u308b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"TIPS(Ruby:\u914d\u5217\u3092\u964d\u9806\u306b\u3059\u308b\u30fb1\u306e\u4f4d\u3092\u53d6\u5f97\u3059\u308b) \u2014 \u3068\u3042\u308bIT\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u30d6\u30ed\u30b0\" \/>\n\t\t<meta property=\"og:description\" content=\"\u554f\u984c Ruby\u3067\u914d\u5217\u3092\u964d\u9806\u306b\u3059\u308b\u306b\u306f\uff1f #\u964d\u9806\u306b\u3059\u308b a = [0,9,4,5] a = a.sort_by\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/suzutukiblog.com\/index.php\/2022\/10\/25\/tips-16\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/suzutukiblog.com\/wp-content\/uploads\/2020\/03\/cropped-cropped-markus-spiske-s7nlaF3kefg-unsplash-1.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/suzutukiblog.com\/wp-content\/uploads\/2020\/03\/cropped-cropped-markus-spiske-s7nlaF3kefg-unsplash-1.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"512\" \/>\n\t\t<meta property=\"og:image:height\" content=\"316\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2022-10-25T11:19:45+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2022-10-28T11:48:10+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"TIPS(Ruby:\u914d\u5217\u3092\u964d\u9806\u306b\u3059\u308b\u30fb1\u306e\u4f4d\u3092\u53d6\u5f97\u3059\u308b) \u2014 \u3068\u3042\u308bIT\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u30d6\u30ed\u30b0\" \/>\n\t\t<meta name=\"twitter:description\" content=\"\u554f\u984c Ruby\u3067\u914d\u5217\u3092\u964d\u9806\u306b\u3059\u308b\u306b\u306f\uff1f #\u964d\u9806\u306b\u3059\u308b a = [0,9,4,5] a = a.sort_by\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/suzutukiblog.com\/wp-content\/uploads\/2020\/03\/cropped-cropped-markus-spiske-s7nlaF3kefg-unsplash-1.jpg\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/suzutukiblog.com\\\/index.php\\\/2022\\\/10\\\/25\\\/tips-16\\\/#blogposting\",\"name\":\"TIPS(Ruby:\\u914d\\u5217\\u3092\\u964d\\u9806\\u306b\\u3059\\u308b\\u30fb1\\u306e\\u4f4d\\u3092\\u53d6\\u5f97\\u3059\\u308b) \\u2014 \\u3068\\u3042\\u308bIT\\u30a8\\u30f3\\u30b8\\u30cb\\u30a2\\u306e\\u30d6\\u30ed\\u30b0\",\"headline\":\"TIPS(Ruby:\\u914d\\u5217\\u3092\\u964d\\u9806\\u306b\\u3059\\u308b\\u30fb1\\u306e\\u4f4d\\u3092\\u53d6\\u5f97\\u3059\\u308b)\",\"author\":{\"@id\":\"https:\\\/\\\/suzutukiblog.com\\\/index.php\\\/author\\\/reim\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/suzutukiblog.com\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/suzutukiblog.com\\\/index.php\\\/2022\\\/10\\\/25\\\/tips-16\\\/#articleImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a1120b253cda8359b20b212f47db49986c2aa710b6ba6ef5825e6871bdbb9c10?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"\\u30aa\\u30aa\\u30bf\"},\"datePublished\":\"2022-10-25T20:19:45+09:00\",\"dateModified\":\"2022-10-28T20:48:10+09:00\",\"inLanguage\":\"ja\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/suzutukiblog.com\\\/index.php\\\/2022\\\/10\\\/25\\\/tips-16\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/suzutukiblog.com\\\/index.php\\\/2022\\\/10\\\/25\\\/tips-16\\\/#webpage\"},\"articleSection\":\"Programming note\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/suzutukiblog.com\\\/index.php\\\/2022\\\/10\\\/25\\\/tips-16\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/suzutukiblog.com#listItem\",\"position\":1,\"name\":\"\\u30db\\u30fc\\u30e0\",\"item\":\"https:\\\/\\\/suzutukiblog.com\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/suzutukiblog.com\\\/index.php\\\/category\\\/programming-note\\\/#listItem\",\"name\":\"Programming note\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/suzutukiblog.com\\\/index.php\\\/category\\\/programming-note\\\/#listItem\",\"position\":2,\"name\":\"Programming note\",\"item\":\"https:\\\/\\\/suzutukiblog.com\\\/index.php\\\/category\\\/programming-note\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/suzutukiblog.com\\\/index.php\\\/2022\\\/10\\\/25\\\/tips-16\\\/#listItem\",\"name\":\"TIPS(Ruby:\\u914d\\u5217\\u3092\\u964d\\u9806\\u306b\\u3059\\u308b\\u30fb1\\u306e\\u4f4d\\u3092\\u53d6\\u5f97\\u3059\\u308b)\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/suzutukiblog.com#listItem\",\"name\":\"\\u30db\\u30fc\\u30e0\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/suzutukiblog.com\\\/index.php\\\/2022\\\/10\\\/25\\\/tips-16\\\/#listItem\",\"position\":3,\"name\":\"TIPS(Ruby:\\u914d\\u5217\\u3092\\u964d\\u9806\\u306b\\u3059\\u308b\\u30fb1\\u306e\\u4f4d\\u3092\\u53d6\\u5f97\\u3059\\u308b)\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/suzutukiblog.com\\\/index.php\\\/category\\\/programming-note\\\/#listItem\",\"name\":\"Programming note\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/suzutukiblog.com\\\/#person\",\"name\":\"\\u30aa\\u30aa\\u30bf\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/suzutukiblog.com\\\/index.php\\\/2022\\\/10\\\/25\\\/tips-16\\\/#personImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a1120b253cda8359b20b212f47db49986c2aa710b6ba6ef5825e6871bdbb9c10?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"\\u30aa\\u30aa\\u30bf\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/suzutukiblog.com\\\/index.php\\\/author\\\/reim\\\/#author\",\"url\":\"https:\\\/\\\/suzutukiblog.com\\\/index.php\\\/author\\\/reim\\\/\",\"name\":\"\\u30aa\\u30aa\\u30bf\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/suzutukiblog.com\\\/index.php\\\/2022\\\/10\\\/25\\\/tips-16\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a1120b253cda8359b20b212f47db49986c2aa710b6ba6ef5825e6871bdbb9c10?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"\\u30aa\\u30aa\\u30bf\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/suzutukiblog.com\\\/index.php\\\/2022\\\/10\\\/25\\\/tips-16\\\/#webpage\",\"url\":\"https:\\\/\\\/suzutukiblog.com\\\/index.php\\\/2022\\\/10\\\/25\\\/tips-16\\\/\",\"name\":\"TIPS(Ruby:\\u914d\\u5217\\u3092\\u964d\\u9806\\u306b\\u3059\\u308b\\u30fb1\\u306e\\u4f4d\\u3092\\u53d6\\u5f97\\u3059\\u308b) \\u2014 \\u3068\\u3042\\u308bIT\\u30a8\\u30f3\\u30b8\\u30cb\\u30a2\\u306e\\u30d6\\u30ed\\u30b0\",\"description\":\"\\u554f\\u984c Ruby\\u3067\\u914d\\u5217\\u3092\\u964d\\u9806\\u306b\\u3059\\u308b\\u306b\\u306f\\uff1f #\\u964d\\u9806\\u306b\\u3059\\u308b a = [0,9,4,5] a = a.sort_by\",\"inLanguage\":\"ja\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/suzutukiblog.com\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/suzutukiblog.com\\\/index.php\\\/2022\\\/10\\\/25\\\/tips-16\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/suzutukiblog.com\\\/index.php\\\/author\\\/reim\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/suzutukiblog.com\\\/index.php\\\/author\\\/reim\\\/#author\"},\"datePublished\":\"2022-10-25T20:19:45+09:00\",\"dateModified\":\"2022-10-28T20:48:10+09:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/suzutukiblog.com\\\/#website\",\"url\":\"https:\\\/\\\/suzutukiblog.com\\\/\",\"name\":\"\\u3068\\u3042\\u308bIT\\u30a8\\u30f3\\u30b8\\u30cb\\u30a2\\u5fd7\\u671b\\u306e\\u30d6\\u30ed\\u30b0\",\"description\":\"\\u6bce\\u65e5\\u5c11\\u3057\\u305a\\u3064\\u6210\\u9577\\u3059\\u308b\",\"inLanguage\":\"ja\",\"publisher\":{\"@id\":\"https:\\\/\\\/suzutukiblog.com\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"TIPS(Ruby:\u914d\u5217\u3092\u964d\u9806\u306b\u3059\u308b\u30fb1\u306e\u4f4d\u3092\u53d6\u5f97\u3059\u308b) \u2014 \u3068\u3042\u308bIT\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u30d6\u30ed\u30b0","description":"\u554f\u984c Ruby\u3067\u914d\u5217\u3092\u964d\u9806\u306b\u3059\u308b\u306b\u306f\uff1f #\u964d\u9806\u306b\u3059\u308b a = [0,9,4,5] a = a.sort_by","canonical_url":"https:\/\/suzutukiblog.com\/index.php\/2022\/10\/25\/tips-16\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/suzutukiblog.com\/index.php\/2022\/10\/25\/tips-16\/#blogposting","name":"TIPS(Ruby:\u914d\u5217\u3092\u964d\u9806\u306b\u3059\u308b\u30fb1\u306e\u4f4d\u3092\u53d6\u5f97\u3059\u308b) \u2014 \u3068\u3042\u308bIT\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u30d6\u30ed\u30b0","headline":"TIPS(Ruby:\u914d\u5217\u3092\u964d\u9806\u306b\u3059\u308b\u30fb1\u306e\u4f4d\u3092\u53d6\u5f97\u3059\u308b)","author":{"@id":"https:\/\/suzutukiblog.com\/index.php\/author\/reim\/#author"},"publisher":{"@id":"https:\/\/suzutukiblog.com\/#person"},"image":{"@type":"ImageObject","@id":"https:\/\/suzutukiblog.com\/index.php\/2022\/10\/25\/tips-16\/#articleImage","url":"https:\/\/secure.gravatar.com\/avatar\/a1120b253cda8359b20b212f47db49986c2aa710b6ba6ef5825e6871bdbb9c10?s=96&d=mm&r=g","width":96,"height":96,"caption":"\u30aa\u30aa\u30bf"},"datePublished":"2022-10-25T20:19:45+09:00","dateModified":"2022-10-28T20:48:10+09:00","inLanguage":"ja","mainEntityOfPage":{"@id":"https:\/\/suzutukiblog.com\/index.php\/2022\/10\/25\/tips-16\/#webpage"},"isPartOf":{"@id":"https:\/\/suzutukiblog.com\/index.php\/2022\/10\/25\/tips-16\/#webpage"},"articleSection":"Programming note"},{"@type":"BreadcrumbList","@id":"https:\/\/suzutukiblog.com\/index.php\/2022\/10\/25\/tips-16\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/suzutukiblog.com#listItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/suzutukiblog.com","nextItem":{"@type":"ListItem","@id":"https:\/\/suzutukiblog.com\/index.php\/category\/programming-note\/#listItem","name":"Programming note"}},{"@type":"ListItem","@id":"https:\/\/suzutukiblog.com\/index.php\/category\/programming-note\/#listItem","position":2,"name":"Programming note","item":"https:\/\/suzutukiblog.com\/index.php\/category\/programming-note\/","nextItem":{"@type":"ListItem","@id":"https:\/\/suzutukiblog.com\/index.php\/2022\/10\/25\/tips-16\/#listItem","name":"TIPS(Ruby:\u914d\u5217\u3092\u964d\u9806\u306b\u3059\u308b\u30fb1\u306e\u4f4d\u3092\u53d6\u5f97\u3059\u308b)"},"previousItem":{"@type":"ListItem","@id":"https:\/\/suzutukiblog.com#listItem","name":"\u30db\u30fc\u30e0"}},{"@type":"ListItem","@id":"https:\/\/suzutukiblog.com\/index.php\/2022\/10\/25\/tips-16\/#listItem","position":3,"name":"TIPS(Ruby:\u914d\u5217\u3092\u964d\u9806\u306b\u3059\u308b\u30fb1\u306e\u4f4d\u3092\u53d6\u5f97\u3059\u308b)","previousItem":{"@type":"ListItem","@id":"https:\/\/suzutukiblog.com\/index.php\/category\/programming-note\/#listItem","name":"Programming note"}}]},{"@type":"Person","@id":"https:\/\/suzutukiblog.com\/#person","name":"\u30aa\u30aa\u30bf","image":{"@type":"ImageObject","@id":"https:\/\/suzutukiblog.com\/index.php\/2022\/10\/25\/tips-16\/#personImage","url":"https:\/\/secure.gravatar.com\/avatar\/a1120b253cda8359b20b212f47db49986c2aa710b6ba6ef5825e6871bdbb9c10?s=96&d=mm&r=g","width":96,"height":96,"caption":"\u30aa\u30aa\u30bf"}},{"@type":"Person","@id":"https:\/\/suzutukiblog.com\/index.php\/author\/reim\/#author","url":"https:\/\/suzutukiblog.com\/index.php\/author\/reim\/","name":"\u30aa\u30aa\u30bf","image":{"@type":"ImageObject","@id":"https:\/\/suzutukiblog.com\/index.php\/2022\/10\/25\/tips-16\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/a1120b253cda8359b20b212f47db49986c2aa710b6ba6ef5825e6871bdbb9c10?s=96&d=mm&r=g","width":96,"height":96,"caption":"\u30aa\u30aa\u30bf"}},{"@type":"WebPage","@id":"https:\/\/suzutukiblog.com\/index.php\/2022\/10\/25\/tips-16\/#webpage","url":"https:\/\/suzutukiblog.com\/index.php\/2022\/10\/25\/tips-16\/","name":"TIPS(Ruby:\u914d\u5217\u3092\u964d\u9806\u306b\u3059\u308b\u30fb1\u306e\u4f4d\u3092\u53d6\u5f97\u3059\u308b) \u2014 \u3068\u3042\u308bIT\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u30d6\u30ed\u30b0","description":"\u554f\u984c Ruby\u3067\u914d\u5217\u3092\u964d\u9806\u306b\u3059\u308b\u306b\u306f\uff1f #\u964d\u9806\u306b\u3059\u308b a = [0,9,4,5] a = a.sort_by","inLanguage":"ja","isPartOf":{"@id":"https:\/\/suzutukiblog.com\/#website"},"breadcrumb":{"@id":"https:\/\/suzutukiblog.com\/index.php\/2022\/10\/25\/tips-16\/#breadcrumblist"},"author":{"@id":"https:\/\/suzutukiblog.com\/index.php\/author\/reim\/#author"},"creator":{"@id":"https:\/\/suzutukiblog.com\/index.php\/author\/reim\/#author"},"datePublished":"2022-10-25T20:19:45+09:00","dateModified":"2022-10-28T20:48:10+09:00"},{"@type":"WebSite","@id":"https:\/\/suzutukiblog.com\/#website","url":"https:\/\/suzutukiblog.com\/","name":"\u3068\u3042\u308bIT\u30a8\u30f3\u30b8\u30cb\u30a2\u5fd7\u671b\u306e\u30d6\u30ed\u30b0","description":"\u6bce\u65e5\u5c11\u3057\u305a\u3064\u6210\u9577\u3059\u308b","inLanguage":"ja","publisher":{"@id":"https:\/\/suzutukiblog.com\/#person"}}]},"og:locale":"ja_JP","og:site_name":"\u3068\u3042\u308bIT\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u30d6\u30ed\u30b0 \u2014 \u6bce\u65e5\u5c11\u3057\u305a\u3064\u6210\u9577\u3059\u308b","og:type":"article","og:title":"TIPS(Ruby:\u914d\u5217\u3092\u964d\u9806\u306b\u3059\u308b\u30fb1\u306e\u4f4d\u3092\u53d6\u5f97\u3059\u308b) \u2014 \u3068\u3042\u308bIT\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u30d6\u30ed\u30b0","og:description":"\u554f\u984c Ruby\u3067\u914d\u5217\u3092\u964d\u9806\u306b\u3059\u308b\u306b\u306f\uff1f #\u964d\u9806\u306b\u3059\u308b a = [0,9,4,5] a = a.sort_by","og:url":"https:\/\/suzutukiblog.com\/index.php\/2022\/10\/25\/tips-16\/","og:image":"https:\/\/suzutukiblog.com\/wp-content\/uploads\/2020\/03\/cropped-cropped-markus-spiske-s7nlaF3kefg-unsplash-1.jpg","og:image:secure_url":"https:\/\/suzutukiblog.com\/wp-content\/uploads\/2020\/03\/cropped-cropped-markus-spiske-s7nlaF3kefg-unsplash-1.jpg","og:image:width":512,"og:image:height":316,"article:published_time":"2022-10-25T11:19:45+00:00","article:modified_time":"2022-10-28T11:48:10+00:00","twitter:card":"summary","twitter:title":"TIPS(Ruby:\u914d\u5217\u3092\u964d\u9806\u306b\u3059\u308b\u30fb1\u306e\u4f4d\u3092\u53d6\u5f97\u3059\u308b) \u2014 \u3068\u3042\u308bIT\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u30d6\u30ed\u30b0","twitter:description":"\u554f\u984c Ruby\u3067\u914d\u5217\u3092\u964d\u9806\u306b\u3059\u308b\u306b\u306f\uff1f #\u964d\u9806\u306b\u3059\u308b a = [0,9,4,5] a = a.sort_by","twitter:image":"https:\/\/suzutukiblog.com\/wp-content\/uploads\/2020\/03\/cropped-cropped-markus-spiske-s7nlaF3kefg-unsplash-1.jpg"},"aioseo_meta_data":{"post_id":"6504","title":null,"description":null,"keywords":[],"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"BlogPosting","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2022-10-25 11:19:45","updated":"2025-06-04 17:47:56","seo_analyzer_scan_date":null},"_links":{"self":[{"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/posts\/6504","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/comments?post=6504"}],"version-history":[{"count":12,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/posts\/6504\/revisions"}],"predecessor-version":[{"id":6524,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/posts\/6504\/revisions\/6524"}],"wp:attachment":[{"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/media?parent=6504"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/categories?post=6504"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/tags?post=6504"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}