Hi all

Given that dequeue function takes O(n) shouldn’t the overall time complexity of this exercise be O(n^2) ?

Here is my solution:

```
def reverseK(queue, k):
if queue.is_empty() or k>queue.size() or k<0:
return None
result = MyQueue()
temp_stack = MyStack()
while queue.size()>k:
temp_stack.push(queue.dequeue())
while not temp_stack.is_empty():
result.enqueue(temp_stack.pop())
while not queue.is_empty():
result.enqueue(queue.dequeue())
return result
```