File tree 1 file changed +15
-9
lines changed
1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * Question Link: https://leetcode.com/problems/implement-queue-using-stacks/
3
+ * Primary idea: queue
4
+ * Time Complexity: O(n), Space Complexity: O(n)
5
+ *
6
+ * Copyright © 2019 Ilyar Mnazhdin. All rights reserved.
7
+
8
+ * Your MyQueue object will be instantiated and called as such:
9
+ * let obj = MyQueue()
10
+ * obj.push(x)
11
+ * let ret_2: Int = obj.pop()
12
+ * let ret_3: Int = obj.peek()
13
+ * let ret_4: Bool = obj.empty()
14
+ */
15
+
1
16
import Foundation
2
17
3
18
class MyQueue {
@@ -29,12 +44,3 @@ class MyQueue {
29
44
return storage. isEmpty
30
45
}
31
46
}
32
-
33
- /**
34
- * Your MyQueue object will be instantiated and called as such:
35
- * let obj = MyQueue()
36
- * obj.push(x)
37
- * let ret_2: Int = obj.pop()
38
- * let ret_3: Int = obj.peek()
39
- * let ret_4: Bool = obj.empty()
40
- */
You can’t perform that action at this time.
0 commit comments