The Māori language has quite simple pronouns. It uses a single word for he/she/they/etc (ia
), and the words for "you" and "me" are koe
and au
respectively.
There are also words for groups of exactly two people:
tāua
- You and me (we,au
andkoe
)māua
- Me and them (we,au
andia
)rāua
- Them (third person plural - two of them,ia
andia
)kōrua
- You two (koe
andkoe
)
And for three or more people:
tātou
- All of you and me (we,au
and multiplekoe
)mātou
- Me and all of them (we,au
and multipleia
)rātou
- All of them (third person plural, multipleia
)koutou
- All of you (multiplekoe
)
Your challenge is to take a list of ia
, koe
and au
and return the correct pronoun. You may assume that there is at most one au
and that ia
and koe
will never both be in the input.
You may take input in any reasonable format - An array of ia
, koe
and au
or three distinct values (within reason) representing those, an array of the counts of each word, a dictionary containing the counts of each word, space-separated words etc.
When there is only one word, you should output that.
Note that some of the outputs contain Unicode (ā
and ō
). You may output these as they are or as double letters - aa
and oo
.
For example, ia ia
becomes rāua
as it is two ia
. au ia ia ia ia
becomes mātou
as it is one au
and more than two ia
. koe koe
becomes kōrua
.
Testcases
ia -> ia
koe -> koe
koe au -> tāua
ia ia -> rāua
koe koe koe koe koe -> koutou
ia ia au ia -> mātou
ia ia ia ia ia ia ia -> rātou
au
and thatia
andkoe
will never both be in the input." \$\endgroup\$