Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lachenmayer/longest-common-subsequence

Finds the longest common subsequence of two strings, and the diff between them.
https://github.com/lachenmayer/longest-common-subsequence

Last synced: 2 days ago
JSON representation

Finds the longest common subsequence of two strings, and the diff between them.

Awesome Lists containing this project

README

        

# longest-common-subsequence

Finds the longest common subsequence of two strings, and the diff between them.

```typescript
function lcs(a: string, b: string): { lcs: string, diff: Array }

type Diff =
| ['keepOld', number] // index in a
| ['addNew', number] // index in b
| ['removeOld', number] // index in a
```