add: 验证回文字符串 Ⅱ

This commit is contained in:
yige authored and yi-ge committed 2020-05-20 15:28:29 +08:00
1 parent 95c8f9aac2
commit 57045d7772
8 files changed
+135 -5

No files matched your search

@@ -0,0 +1,6 @@
import { maxProduct } from '../../src/array/maximum-product-subarray'
test('', () => {
expect(maxProduct([2, 3, -2, 4])).toBe(6)
expect(maxProduct([-2, 0, -1])).toBe(0)
})
+6
View File
@@ -0,0 +1,6 @@
import { findOrder } from '../../src/graphs/course-schedule-ii'
test('课程表 II', () => {
expect(findOrder(2, [[1, 0]])).toEqual([0, 1])
expect(findOrder(4, [[1, 0], [2, 0], [3, 1], [3, 2]])).toEqual([0, 1, 2, 3])
})
+8
View File
@@ -0,0 +1,8 @@
import { validPalindrome } from '../../src/string/valid-palindrome-ii'
test('验证回文字符串 Ⅱ', () => {
expect(validPalindrome('aba')).toBe(true)
expect(validPalindrome('abba')).toBe(true)
expect(validPalindrome('abca')).toBe(true)
expect(validPalindrome('abcda')).toBe(false)
})