This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Calculate Levenshtein distance between two strings | |
* @param {string} str1 - First string | |
* @param {string} str2 - Second string | |
* @returns {number} - The Levenshtein distance | |
*/ | |
function levenshteinDistance(str1, str2) { | |
// Create matrix | |
const matrix = []; | |
OlderNewer