📌  相关文章
📜  day 18 queues and stacks hackerrank解决方案javascript代码示例

📅  最后修改于: 2022-03-11 15:02:37.391000             🧑  作者: Mango

代码示例1
// day 18 queues and stacks hackerrank solution javascript
function Solution(){
  //Write your code here
    this.stack = [];
    this.queue = [];
    
    Solution.prototype.pushCharacter = this.stack.push;
    Solution.prototype.popCharacter = this.stack.pop;
    Solution.prototype.enqueueCharacter = this.queue.push;
    Solution.prototype.dequeueCharacter = this.queue.shift;
}