minDistance = (word1, word2, i = 0, j = 0) => {
    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);

    return dfs(word1, word2, i, j);/* Time O(2^(N + M)) | Space O((N * M) + HEIGHT) */
}
Brute Force - DFS
Time O(2^(N + M)) | Space O(N * M)
https://leetcode.com/problems/edit-distance/
@param {string} word1
@param {string} word2
@return {number}