Example I have this array:
@packages = ["2", ["4", "2", "1"], "4", ["4","2"], ["5", "6"]]
2 and 4 may not be composed
There for ["4", "2", "1"] and ["4,"2"] should be removed from the array
How should it be done?
So the output would be: @packages = ["2", "4", ["5", "6"]]
2 and 4 is just an example. And the number of numbers vary also.
If you want to remove arrays, that have at least 2 elements in common with given do:
After this
@packages => ["2", "4", ["3", "2"]]