首发于 语雀@blueju
https://leetcode-cn.com/problems/yong-liang-ge-zhan-shi-xian-dui-lie-lcof/submissions/
var CQueue = function () {this.inStack = []this.outStack = []};/*** @param {number} value* @return {void}*/CQueue.prototype.appendTail = function (value) {this.inStack.push(value)};/*** @return {number}*/CQueue.prototype.deleteHead = function () {if (this.outStack.length === 0) {if (this.inStack.length === 0) {return -1} else {this.inStack.forEach(item => {this.outStack.unshift(item)})this.inStack = []return this.outStack.pop()}} else {return this.outStack.pop()}};/*** Your CQueue object will be instantiated and called as such:* var obj = new CQueue()* obj.appendTail(value)* var param_2 = obj.deleteHead()*/
