Deduplicate Files

Asked at Anthropic · Coding Questions · Difficulty: Medium · Last asked Jun 23, 2026

A directory tree often holds many copies of the same file under different names. Write a function that scans a tree and reports which files have exactly the same content, so the extra copies can be found and removed. The tree can be very large, so the function must avoid reading file content it does not need to read.

Loading the problem…