Discard all cards
0 Answers
Discard all cards
| Flag | PURGE
You have 13 sorted cards, every cards from "2 ,3, 4, 5, 6, 7, 8, 9, 10, J, Q, K, A".
you can discard all cards, according to some rules:
a pair of cards, like: 2,2
three cards, like: 8,8,8 or 8,9,10; J,Q,K
card A can convert to any cards as you wish, like: A -> 3
For example: Input: 2 2 3 4 5 5 6 7 8 8 9 9 9
you can discard: 2 2
3 4 5
5 6 7
8 8
9 9 9
output:
TURE
Input:
2 2 3 4 5 5 6 7 8 9 10 J A
āAā can be converted to āJā, so
you can discard
2 2
3 4 5
5 6 7
8 9 10
J J
output
TRUE
Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.