This theory is part of Premium
The full write-up (worked counting examples, the trap list and the interview playbook) unlocks with a Premium plan, along with every Pro visualizer.
See pricingFind the longest substring that appears at least twice.
What this asks
Find the longest substring that appears at least twice.
Binary search the answer length, hashing every window of that length and looking for a repeat.
The full write-up (worked counting examples, the trap list and the interview playbook) unlocks with a Premium plan, along with every Pro visualizer.
See pricing