Solve 1.6.Approximate_Pattern_Matching_Problem