add: 用两个栈实现队列
This commit is contained in:
7
test/stack/decode-string.test.js
Normal file
7
test/stack/decode-string.test.js
Normal file
@ -0,0 +1,7 @@
|
||||
import { decodeString } from '../../src/stack/decode-string'
|
||||
|
||||
test('字符串解码', () => {
|
||||
expect(decodeString('3[a]2[bc]')).toBe('aaabcbc')
|
||||
expect(decodeString('3[a2[c]]')).toBe('accaccacc')
|
||||
expect(decodeString('2[abc]3[cd]ef')).toBe('abcabccdcdcdef')
|
||||
})
|
Reference in New Issue
Block a user