Quant Memo
Coding/●●●●

Fewest deletions to make two configs identical

Two deployment config files list settings line by line. You are allowed to delete lines from either file but never to add or change one, and you want both files to end up identical with as few deletions as possible.

a = "sea", b = "eat"
-> 2           # delete 's' from a and 't' from b, both become "ea"

Return the minimum total number of deletions (across both strings) that makes them equal. Target O(ab)O(|a|\cdot|b|) time.

Your answer

This one is open-ended. Work it through, then check your reasoning against the full solution.

More Coding questions