Most efficient way to select elements in 2d array in Ruby

前端 未结 0 1105
礼貌的吻别
礼貌的吻别 2020-12-11 13:38

Let\'s say I have 2d array (or matrix) like,

m = [
 [1, 2, 3],
 [4, 5, 6],
 [7, 8, 9]
]

And, I\'ve to select all elements in eight directions

相关标签:
回答
  • 消灭零回复
提交回复
热议问题