想到队列的反转那肯定首先想到的就是堆栈(同理堆栈反转也可以利用队列)
有一个办法我们可以将K个元素入栈,然后可以另一个队列将剩下的元素放入,随后我们首先将栈元素回归原来的队列,最后将临时队列也入队。
代码省略!