minDistance = (word1, word2, i = 0, j = 0, memo = initMemo(word1, word2)) => {
    const isBaseCase1 = ((word1.length * word2.length) === 0);
    if (isBaseCase1) return (word1.length + word2.length);

    const isBaseCase2 = (word1.length === i);
    if (isBaseCase2) return (word2.length - j);

    const isBaseCase3 = (word2.length === j);
    if (isBaseCase3) return (word1.length - i);

    const hasSeen = (memo[i][j] !== -1);
    if (hasSeen) return memo[i][j];

    return dfs(word1, word2, i, j, memo);/* Time O(N * M) | Space O((N * M) + HEIGHT) */
}
DP - Top Down
Matrix - Memoization
Time O(N * M) | Space O(N * M)
https://leetcode.com/problems/edit-distance/
@param {string} word1
@param {string} word2
@return {number}