I have a poker hand and I need to check for three of a kind. Is there a way to see if 3 elements in the vector are the same but the other 2 are different?
E.g.:
hand <- c("Q","Q","6","5","Q")
Should return TRUE
for three of a kind.
hand2 <- c("Q","Q","6","6","Q")
...would be a full-house though, and shouldn't be identified as a three of a kind.