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

* Implemented Palindrome Partitioning using Backtracking algorithm * fix:Updated palindromePartition algorithm * code clean up * Rephrase doc comment & move to appropriate function --------- Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
13 lines
396 B
JavaScript
13 lines
396 B
JavaScript
import partitionPalindrome from '../PalindromePartitioning'
|
|
|
|
describe('Palindrome Partitioning', () => {
|
|
it('should return all possible palindrome partitioning of s', () => {
|
|
expect(partitionPalindrome('aab')).toEqual([
|
|
['a', 'a', 'b'],
|
|
['aa', 'b']
|
|
])
|
|
expect(partitionPalindrome('a')).toEqual([['a']])
|
|
expect(partitionPalindrome('ab')).toEqual([['a', 'b']])
|
|
})
|
|
})
|