* @brief Calculates and stores the result * of all the sub-problems, so that we don't have to recur to compute * the minimum cost of a particular operation if it is already * computed and stored in the `dp` vector. * @param dp vector to store the computed minimum costs * @param str1 to pass the 1st string * @param str2 to pass the 2nd string * @param m the length of str1 * @param n