You are given two arrays — ranks and suits — each of size 5, representing a hand of five playing cards.
The i-th card has:
rank = ranks[i]
suit = suits[i]
From these cards, your task is to determine the strongest possible poker hand according to the following hierarchy:
Flush — All five cards share the same suit.
Three of a Kind — Exactly three cards share the same rank.
Pair — At least two cards share the same rank.
High Card — None of the above.
Return the name of the highest-ranking hand you can make.
The output must match the exact capitalization shown.
Input: ranks = [7, 5, 9, 2, 7] suits = ["x","x","x","x","x"]
Output: "Flush"
Explanation:
All suits match → highest hand is a Flush.
Input: ranks = [8, 3, 8, 6, 8] suits = ["h","d","s","c","d"]
Output: "Three of a Kind"
Explanation:
The rank 8 appears three times.
Input: ranks = [2, 11, 5, 11, 9] suits = ["a","b","c","d","e"]
Output: "Pair"
Explanation:
The rank 11 appears twice.
Accepted:
Submission: