Computes the intersection of arrays with additional index check, compares indexes by a callback function