Comment
Comment by xashor
In J (which might be slower than K) with excessive comments for a one-liner:
On two ~1.6MB files with ~15k lines (both the same except 3) I had lying around:
Note that most of the script is for loading each file into an array of lines. Most work is done by -. on the two arrays, which is exactly what you asked for, e.g. 0 1 2 3 4 -. 2 4 is 0 1 3. https://code.jsoftware.com/wiki/Vocabulary/minusdot#dyadic