Ad
  • Custom User Avatar

    complexity is not NxM, but Nxlog(M) (even N, due to O(1) get complexity from hash, but it is not guaranteed), but additional memory is N+M instead of N
    overall this is much better than inner loop, even if filter array is not big enough