LoginSignup
0
0

More than 3 years have passed since last update.

Ruby 行と列を入れ替えて配列の配列を作成する方法

Posted at

paizaのスキルチェックで使った内容を投稿しました

array = [[1 ,2, 3], [4,5,6], [7,8,9]]
p array.transpose
>> [[1,4,7],[2,5,8],[3,6,9]]
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0