Last Update: Jul.8,2026

JavaScript Sample

動作確認: ○Firefox115(Win7) ○Chrome109(Win7)

■ 2つの文字列の差分を検出(Myers のアルゴリズム)

文字列: ⇒

▼編集距離(Levernshtein 距離)


▼最長共通部分列(LCS)の長さ


▼最短編集スクリプト(SES)


参考:Implementing the Myers Diff Algorithm in TypeScript — Character-Level Precision | by Eresh Gorantla | Dev Genius

■ ソース