ary=[ [[0, 0], [0, 1], [0, 2]],
[[0, 3], [0, 4], [0, 5]],
[[0, 6], [0, 7], [0, 8]] ]
Run Code Online (Sandbox Code Playgroud)
我试图在"主"数组中找到包含数组的索引[0, 4],即1.
我一直在研究这样的想法:
ary.each_index.select{|index| #(return index if [0,4] matches) }
Run Code Online (Sandbox Code Playgroud)