I have an array of arrays:
(1, 3), (3, 5, 7), (2, 3, 4), (3, 7, 9)
I need to find a value that appears in all sub-arrays,
and in this case that number is “3”.
The most efficient solution I could find was O(n^3) and I was wondering whether there is more efficient way to achieve this.
You can try with
array_intersect:or much automatically: