Arrays intersection function