Given a string Text, a collection of strings Patterns, and an integer d.
Return all positions in Text where a string from Patterns appears as a substring with at most d mismatches.
Implement the approximate_occurrences method which takes a filename, containing a string and a couple of string patterns (both without a '$'!) split by newlines.
The function should return a sorted list of indices where one of the patterns can be matched with the string (if 2 patterns match at an index, put it twice in the list).
>>> approximate_occurrences('data01.txt'1, 1) [9, 32, 34, 38, 69, 91, 106, 147, 152, 157, 159, 172, 175, 185] >>> approximate_occurrences('data02.txt'2, 1) [126, 272]