Unaligned Dedupe

Problem Overview

  • Choose a block size l (l >= k) to split each string and maximize saved characters by deduping blocks seen earlier in the same or immediately previous string.
  • Input: n lowercase strings, each length m, and k; Output: [best l, total savings]; if tied, pick the smallest l.
  • References take zero space; the last block in a string may be shorter than l.
  • Constraint highlight: total data size n*m <= 1.5e6.
  • Real-world: Rubrik Blobstore deduplication; a Rubrik coding interview question and interview problem.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: