add: 最长回文字符串

This commit is contained in:
2020-05-22 21:25:03 +08:00
parent 2120bcdecf
commit a2ccc4764b
4 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,6 @@
import { longestPalindrome } from '../../src/string/longest-palindromic-substring'
test('最长回文字符串', () => {
expect(longestPalindrome('babad')).toBe('aba') // bab也是有效答案
expect(longestPalindrome('cbbd')).toBe('bb')
})