Playing with cards (In stack)

can anyone please tell me what is wrong in my code??
all test cases are not getting passed.