Playing with cards(In stacks)

Giving wrong answer while submitting .Dont know the mistake?