{"type":"rich","provider_url":"https://hatena.blog","url":"https://takayasugiyama.com/entry/2023/02/06/151918","image_url":null,"author_url":"https://blog.hatena.ne.jp/s-takaya1027/","blog_title":"\u4f55\u304b\u3084\u3063\u3066\u307f\u308b\u30d6\u30ed\u30b0","version":"1.0","author_name":"s-takaya1027","description":"\u7a7a\u304d\u6642\u9593\u306b\u30b5\u30af\u30c3\u3068 problem leetcode.com \u89e3\u3044\u305f # @param {Integer[]} nums # @param {Integer} n # @return {Integer[]} def shuffle(nums, n) first = nums[0...n] second = nums[n..] result = [] (2 * n).times do |i| if i.even? result << first.shift else result << second.shift end end result end","categories":[],"height":"190","provider_name":"Hatena Blog","published":"2023-02-06 15:19:18","width":"100%","blog_url":"https://takayasugiyama.com/","title":"LeetCode Shuffle the Array\u3092\u89e3\u3044\u305f\u3002","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftakayasugiyama.com%2Fentry%2F2023%2F02%2F06%2F151918\" title=\"LeetCode Shuffle the Array\u3092\u89e3\u3044\u305f\u3002 - \u4f55\u304b\u3084\u3063\u3066\u307f\u308b\u30d6\u30ed\u30b0\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>"}