Edit distance :showing tle in top down


can u tell me why my top down approach is giving tle whereas it is working fine for bottom up

@sjduttabbsr2017 Hey there are few things that I would Like to point out.

  1. Recursive solutions have added overhead of maintaining function stacks internally.
  2. You are passing strings by value so add extra O(n) with every call.
  3. You are using map instead of matrix so again for every access to the n,m add logn.
    When the solution is not recursive you will not have added issue of point 1 and 2. Pass strings by refeence and use matrix
    If this resolves your doubt mark it as resolved.