Edit distance string

question:https://online.codingblocks.com/player/1972/content/900
code:https://ide.codingblocks.com/#/s/13938 bottom up is passing all but top down shows TLE on gfg both are being accepted on online.codingblocks test cases are taking 5 sec!!

QUES:You are given 2 strings s1 and s2. You can perform the following operations on them:

Insert a character at any position.
Remove a character from any position.
Replace a character with any other character.
Find the minimum number of these operations required to convert s1 to s2.
Input Format:
First line contains string s1. Second line contains string s2.

Constraints:
1<=|s1|,|s2|<=2000 s1 and s2 contains only lowercase English letters.

Output Format
Print a single integer denoting the minimum number of operations required.

Sample Input
abcde bcdae

Sample Output
2