Files
JavaScript/String/test/ZFunction.test.js
Adrito Mukherjee 7fb121508d algorithm: ZFunction (#1239)
* algorithm: ZFunction

* made requested changes

* corrected spelling mistakes

* made requested changes
2022-10-31 22:12:06 +05:30

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
])
})