Reveal Cards In Increasing Order
ID: 950; medium
Solution 1 (Java)
Notes
The queue simulates the deck operations described in the problem.
We first sort the array and reveal one card, then we put the card after the revealed card to the bottom of the deck (end of queue).
Time complexity:
O(nlogn)
Last updated