Skip to content

Commit 399d2e4

Browse files
committed
Update index.ts
1 parent e3b3076 commit 399d2e4

File tree

1 file changed

+3
-3
lines changed
  • implement-queue-using-stacks-lcci

1 file changed

+3
-3
lines changed

implement-queue-using-stacks-lcci/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ class MyQueue<T = any> {
1111
if (!this.#inStack.length) {
1212
return -1;
1313
}
14-
this.in2out();
14+
this.#in2out();
1515
}
1616
return this.#outStack.pop() as T;
1717
}
18-
in2out() {
18+
#in2out() {
1919
while (this.#inStack.length) {
2020
this.#outStack.push(this.#inStack.pop() as T);
2121
}
@@ -25,7 +25,7 @@ class MyQueue<T = any> {
2525
if (!this.#inStack.length) {
2626
return -1;
2727
}
28-
this.in2out();
28+
this.#in2out();
2929
}
3030
return this.#outStack[this.#outStack.length - 1] as T;
3131
}

0 commit comments

Comments
 (0)