How the Diff Algorithm Works
This tool implements a simple line-by-line comparison: each input is split on newlines, then corresponding lines are compared by string equality. Lines present only in the original are marked with - (deletion); lines present only in the modified version are marked with + (insertion); unchanged lines are prefixed with two spaces. For more sophisticated needs (longest common subsequence, character-level diffs, syntax-aware diffs), use dedicated tools like git diff, diff -u, delta, or difftastic.