Edit distance with modification

This is a question I encountered in a Test and I was not able to solve it then. I have implemented what I could possibly think of but I am specifically I think my logic for Edit Distance function here is wrong.

Whatever else I am thinking is not working.

Approach:
removing character from main string using method similar to edit distance on every substring taken from main string.
if ED is less than given k (ans+1)