ãPython ã§ãªã¹ãå ã®ãªã¹ããé£çµã ã®ã¤ã¥ã 1. Ruby ã® flatten ã¡ã½ããã¨åãé¢æ°ãæ¸ããã ååãPython ã§ããªã¹ãå ã®ãªã¹ããçµåãããå¦çãæ¸ããã Ruby ã§ããã¹ããããªã¹ããçµåãããã¡ã½ãã㯠Array#flatten ãRuby ã® flatten ã¯ãã©ãã ããã¹ããæ·±ãã¦ããã©ãããªé åã«ãã¦è¿ããã¾ãããªã¹ãå ã®è¦ç´ ã®ãã¹ãã®æ·±ããç°ãªã£ã¦ãã¦ãããã©ããã«ãã¦ãããã irb(main):001:0> [1,[2,3,[4],5],6].flatten => [1, 2, 3, 4, 5, 6] ãã®ãã㪠Ruby ã® flatten ã¡ã½ããã¨åãé¢æ°ããPython ã§æ¸ãããã 2. ãã¹ããããªã¹ããå¹³å¦åããé¢æ° flatten ããã¹ããããªã¹ããã«å¯¾ããå¦çãæ¸ãããã¨ãããã cf. Python ã§ãªã¹ãã«å¯¾ã
{{#tags}}- {{label}}
{{/tags}}