The different suits should be grouped and
the ranks should be sorted within each suit. But the order of the suits does
not matter and within each suit, the cards may be sorted in either ascending or
descending order on rank. It is allowed for some suits to be sorted in
ascending order and others in descending order.
What
is the smallest number of exchanges or moves required to sort a given hand of
cards?
There is no more than 10 testcases n >
10 。
For each testcase, print an integer
respecting your answer in one line.
3 4 2h 9h 3c Ah 4 Ah 3h 6h 9h 4 9s 9h 9d 9c
1 1 0