Check if an array is subset of another array in Ruby

后端 未结 4 467
遥遥无期
遥遥无期 2020-12-10 10:44

How can I check whether one array is a subset of another array, regardless of the order of elements?

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

...?

a         


        
4条回答
提交回复
热议问题