i has value ranks[i] and suit suits[i]. The combinations, from strongest to weakest, are:
1. "Flush": all five cards share a suit;
2. "Three of a Kind": three cards with the same value;
3. "Pair": two cards with the same value;
4. "High Card": any single card.
Return the name of the strongest combination you can form from these cards, spelled exactly as above (case matters).ranks=[2, 8, 11, 5, 13], suits=["c", "c", "c", "c", "c"] → 'Flush'
All five cards share suit c, so it is a "Flush", the top combination.
ranks=[9, 3, 9, 9, 6], suits=["a", "b", "c", "d", "a"] → 'Three of a Kind'
Three nines make "Three of a Kind"; a pair is also there, but three of a kind ranks higher.
ranks=[1, 4, 7, 10, 12], suits=["a", "b", "a", "d", "c"] → 'High Card'
All values differ and the suits are mixed, so only "High Card" remains.
ranks.length = suits.length = 5ranks[i] ≤ 13suits[i] is one of a, b, c, dranks=[2, 8, 11, 5, 13], suits=["c", "c", "c", "c", "c"]
'Flush'
Run checks the first 3 tests in your browser. Submit checks all 51 tests on the server, hidden ones included.