Mask secret occurrences
Your task
A scrubber hides a leaked secret before an incident report is shared. It works one character at a time: masking a character replaces it with a symbol nobody can read, which breaks every occurrence of the secret that covers that position. The report is safe once no occurrence survives anywhere in it, and occurrences may overlap, so a single mask can break several at once. Reviewers hate a page full of holes, so the scrubber masks as few characters as it possibly can. Given report and secret, return the smallest number of characters that have to be masked. Return 0 when secret is empty, when it is longer than report, or when it never appears.
Examples
secret_mask_budget(report: str, secret: str) -> intExample 1
Input
secret_mask_budget("aaaa", "aa")Output
2Example 2
Input
secret_mask_budget("abcabcabc", "abc")Output
3Example 3
Input
secret_mask_budget("banana", "an")Output
2