如果我要查找的值是两个1维数组,请说a1 = [valueineed,valueidontneed,valueidontneed]
和a2 = [valueineed,valueidontneed,valueidontneed]
,我可以做
array1.combination(2).select { |x, y| array2.include? x + y }.each do |x,y|
do_something x, y
end
但我有这个数组。 a1 = [[valuineed,valueidontneed],[valueineed,valueidontneed]], a2 = [[valueineed,valueidontneed],[valueineed, valueidontneed]]
如何实现上述程序在新数组