1.1.0 • Published 8 years ago
lcp v1.1.0
LCP - Longest Common Prefix
Computes the longest common prefix for strings using a Trie
API
var LCP = require('lcp')
var lcp = new LCP(['fooseball', 'foobar', 'foam'])
lcp.addWord('foobar')
lcp.lcp() // 'fo'
or if you don't like classes
LCP.findLCP(['fooseball', 'foobar', 'foam']) // 'fo'