mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-07 02:05:08 +08:00
algorithm: ZFunction (#1239)
* algorithm: ZFunction * made requested changes * corrected spelling mistakes * made requested changes
This commit is contained in:
8
String/test/ZFunction.test.js
Normal file
8
String/test/ZFunction.test.js
Normal file
@ -0,0 +1,8 @@
|
||||
import zFunction from '../ZFunction'
|
||||
|
||||
test('Testing zFunction', () => {
|
||||
expect(zFunction('aabxaayaab')).toEqual([10, 1, 0, 0, 2, 1, 0, 3, 1, 0])
|
||||
expect(zFunction('aabxaabxcaabxaabxay')).toEqual([
|
||||
19, 1, 0, 0, 4, 1, 0, 0, 0, 8, 1, 0, 0, 5, 1, 0, 0, 1, 0
|
||||
])
|
||||
})
|
Reference in New Issue
Block a user