Eg str1 = "heap", str2 = "pea"
O/P : 1 deletion & 2 insertions
why : Deleting 'h' from 'heap' gives us 'eap' and now deleting 'p' from 'eap' gives us 'ea'
Now inserting 'p' gives us string 2 i.e 'pea'
Approach: Observe carefully that their LCS i.e longest common subsequence of the 2 strings remain same and We need to delete some characters from string 1 to reduce it to LCS and then adding some characters to LCS to convert to string 2
str1 = "heap", str2 = "pea"

So :
void MinDelAndInsert(string str1, string str2)
{
int m = str1.size();
int n = str2.size();
int LCS_Len = LCS(str1, str2, m, n);
cout << "Minimum number of deletions = " << (m - LCS_len)
<< endl;
cout << "Minimum number of insertions = " << (n - LCS_len)
<< endl;
}