Skip to content

Instantly share code, notes, and snippets.

View kottenator's full-sized avatar

Rostyslav Bryzgunov kottenator

  • Facebook
  • Seattle, WA
View GitHub Profile
@kottenator
kottenator / diff.js
Created April 15, 2018 19:54
Own custom diff
/*
Specific conditions:
- input: `oldString` and `newString` (e.g. `'old same'` and `'same new'`)
- output format: `'(old )same[ new]'`
- return diff of min length, not counting `()[]`
- return diff which is min among all diff variants by lexicographical order, with one remark: consider `\w` < `()` < `[]`
Taken from CodeFights: Dropbox bot challange.
*/