For this challenge, you need to compress a diff. A diff is some data that represents the difference between two strings. For this challenge, you need to provide one or more programs that can:
- Input
A
andB
, and output a diff,C
- Input
A
andC
, and outputB
- Input
B
andC
, and outputA
The goal is to make the diff, C
, as small as possible. The diff can be anything: a string, a number, a blob of data. We just care about the size (number of bytes).
I have 50 test cases that can found on Github. Each test case consists of two space-separated URLs which point to the 2 files you need to diff. (These test cases originated from PPCG members' Github profiles. Thanks all!)
All three tasks above should take under a minute to run on a reasonably powered computer (for each test case).
Your score is equal to the total size (in bytes) of all 50 diffs, lower is better. Hardcoding diffs in your program is not allowed (I reserve the right to change the test cases to prevent hardcoding). Builtins that produce a diff (like diffutils
) are not allowed.
A
andB
\$\endgroup\$