Merge branch 'master' of git.hxr.so:yige/js-practice

This commit is contained in:
2020-05-13 14:40:43 +08:00
3 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,13 @@
import { MinStack } from '../../src/stack/min-stack'
test('最小栈', () => {
var obj = new MinStack()
obj.push(1)
obj.push(3)
obj.push(2)
obj.pop()
var top = obj.top()
var min = obj.getMin()
expect(top).toBe(3)
expect(min).toBe(1)
})