Playing with cards cant understand

Can you plz explain the problem once. The problem is not that clear to me.

hey @shivanshmittal25, I have already answered this question in some other thread please refer to it PLAYING WITH CARDS (IN STACK) - Doubt