s9e / shortest-common-superstring
Shortest common superstring generator
Installs: 18
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
pkg:composer/s9e/shortest-common-superstring
Requires
- php: >=7.1
Requires (Dev)
- phpunit/phpunit: ^7 || 8.2.*
README
s9e\ShortestCommonSuperstring takes a list of strings and returns a single string that contains all of the given input. The implementation uses a greedy approximation algorithm.
Usage
$scs = new s9e\ShortestCommonSuperstring\ShortestCommonSuperstring; echo $scs->getShortest(['abb', 'bba', 'bbb']);
abbba