add: 最大正方形

This commit is contained in:
2020-05-08 12:42:10 +08:00
parent 431ac87901
commit 3b8d9b3f40
3 changed files with 45 additions and 0 deletions

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)
})