Mask secret occurrences
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.
secret_mask_budget(report: str, secret: str) → int["aaaa","aa"]out2["abcabcabc","abc"]out3["banana","an"]out2State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
["aaaa","aa"]2not run yetsample["abcabcabc","abc"]3not run yetsample["banana","an"]2not run yetsample