Ticket A: The first 3 digits and the last 2 digits match, the 4th digit is incorrect, so this ticket wins 5 numbers out of 6.
Ticket B: This ticket has only one digit in order, respectively, if there are tickets where there are more than 1 matches, then ticket B wins nothing. If there are no more tickets with matching digits than 1, then ticket B will return the cost of the ticket.