Reveal Cards In Increasing Order
In a deck of cards, each card has an integer value. You are given a deck of cards represented by an array. Each integer in the array represents the value of a card. You need to reveal cards in increasing order.
To do this, you will:
Start with an empty list. Pick the top card of the deck and reveal it. If the revealed card is not the bottom card of the list, move the revealed card to the bottom of the list. Repeat step 2 and 3 until all cards are revealed. Return an array that contains the revealed cards in increasing order.
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)