![:o](./images/smilies/icon_eek.gif)
But I managed to get AC. This is a simulation problem, there's not much logic involved, so I'll give out detailed steps on how to get AC.
1. There are 52 cards, the score of the cards = {A, K, Q, J, T} = 10, rest are their independent numbers. There's a comment lurking here that misguides you about this, what I've mentioned in this point is the right way to score individual cards.
2. The cards are indexed backwards. first element in the array is the 52th card (bottom of the pile).
3. Indexing starts from 1 in the problem, you should account for it while using zero indexes.
Simulation: Remove the top 25 cards, and keep them somewhere safe. So your pile will the 26th card on the top. Perform the iteration specified (Find the score of the card which is at the top, remove it. Depending on the score remove [10 - X] more cards from the top of the pile[can be zero]). Once the iteration is done, put back those those original 25 cards which you removed initially.
While performing the three iterations, do remember to keep track of the sum of the scores (a.k.a Y in our problem) of each card which was on the top when that iteration started.
The solution is to find the Yth card from the bottom accounting for all the removed cards from the deck.