add: 最大正方形

This commit is contained in:
yige committed 2020-05-08 17:42:56 +08:00
1 parent 431ac87901
commit 3b8d9b3f40
3 files changed
+45

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
import { maximalSquare } from '../../src/array/maximal-square'
test('最大正方形', () => {
expect(maximalSquare([
[1, 0, 1, 0, 0],
[1, 0, 1, 1, 1],
[1, 1, 1, 1, 1],
[1, 0, 0, 1, 0]
])).toBe(4)
expect(maximalSquare([
[0, 0, 0],
[1, 1, 1]
])).toBe(1)
})