Can you please explain why upper limit is 2 * n?

can you please explain why upper limit is 2 * n?

2*n is the worst case scenario, i.e, when you have all the blank cards in your hand and the cards in the pile are arranged in descending order, so in this case you have to play n blank cards , i.e., n moves and then n more moves to place cards in order.
For example consider this testcase
2
0 0
2 1

Now you first play blank card and pick up 2 from pile, then you again play blank card and pick up 1.
In the next move you play 1 and then you play 2.
So 4 moves in total, i.e., 2*n moves