Introduction
Congratulations! You've been selected to do research a a newly discovered animal called a fuzzy, a docile, simple creature that strongly resembles a cotton ball. Fuzzies love to be near other fuzzies, but not all fuzzies want to be near each other.
There are 6 types of fuzzies, 1a, 1b, 2a, 2b, 3a, and 3b. Each obeys different rules.
Type 1a fuzzies want to be near any type b fuzzy. (vice versa for 1b)
Type 3a fuzzies want to be near any type a fuzzy. (vice versa for 3b)
Finally, type 2 fuzzies want to be near any fuzzy type, a or b.
Perfect pairings are matches in which both fuzzies want to be near each other (ex. 1a and 1b)
Semiperfect pairings are matches in which only one fuzzy wants to be near the other (ex 3a and 1b)
Imperfect pairings are matches in which neither fuzzy wants to be with the other (ex. 3a and 3b)
Your Challenge
Given a list of fuzzies:
- Output the total number of perfect pairings. If there are any left:
- Output the number of semiperfect pairings. If there are any left:
- Output how many leftover bachelors there are.
Output and input format don't matter as long as you state them both.
Test cases
1a, 1b:
1a and 1b are a perfect match
> 1 perfect, 0 semiperfect, 0 bachelors
1a, 2b, 2a, 3b:
1a and 2b are a perfect match
2a and 3b are a semiperfect match
> 1 perfect, 1 semiperfect, 0 bachelors
1a, 1b, 2a, 3a, 3b, 3b:
1a and 1b are a perfect match
2a and 3a are a perfect match
3b and 3b are an imperfect match
> 2 perfect, 0 semiperfect, 1 bachelor
1b, 2a, 3a
1b and 2a are a perfect match
3a is left over
(note: could also be:
2a and 3a are a perfect match
1b is left over
for the same result)
> 1 perfect, 0 semiperfect, 1 bachelor
Scoring
This is code-golf, so shortest in bytes wins.