js-practice/test/string/longest-palindromic-substring.test.js

7 lines
246 B
JavaScript
Raw Normal View History

2020-05-22 21:25:03 +08:00
import { longestPalindrome } from '../../src/string/longest-palindromic-substring'
test('最长回文字符串', () => {
expect(longestPalindrome('babad')).toBe('aba') // bab也是有效答案
expect(longestPalindrome('cbbd')).toBe('bb')
})