Tier 3 · Warlockcapture
Name The Pair
A hand is five cards as "AS 7H 7D 9C KS" — rank then suit, space separated, and always sorted by rank, ascending. Capture the rank that appears more than once, or match nothing if every rank is different.
Sorted means duplicate ranks are neighbours, so you are comparing one rank with the rank exactly three characters later. The trap is that suits are neighbours too — a lazy pattern will happily report a shared suit as a pair, so make sure your group can only start where a card starts.
Your pattern0 chars · par 14
//
Flags
Start typing — tests run as you go.0 of 5 visible tests passing
Test cases
AS 7H 7D 9C KS→ ["7"]AS AH 5D 9C KS→ ["A"]2S 2H 2D 9C KS→ ["2"]three of a kind counts
2S 5H 9D TC KSmust not match2S 5S 9S TS KSmust not matchfive spades — a shared suit is not a pair
+ 7 hidden tests, checked when you submit. They are what stops a pattern that only fits the examples above.