mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 08:16:50 +08:00

* algorithm: ZFunction * made requested changes * corrected spelling mistakes * made requested changes
9 lines
269 B
JavaScript
9 lines
269 B
JavaScript
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
|
|
])
|
|
})
|