比较有意思的模拟题,花了点时间,主要是我没有认真读题模拟。。
from collections import deque class Solution(object): def deckRevealedIncreasing(self, deck): """ :type deck: List[int] :rtype: List[int] """ deck.sort(reverse=True) ret = deque() for i in deck: ret.rotate(1) ret.appendleft(i) return list(ret)