Poker: Flush Detection

Detect a Flush in a hand of poker with Python.

A Flush in poker refers to a hand where all five cards belong to the same suit. Write a Python function to determine if a set of 7 cards can form a Flush. The function should take two lists of strings as arguments representing cards: - The first list signifies the 5 community cards on the table. - The second list signifies the 2 pocket cards in the player's hand. Each string in the list follows the format 'Rank_Suit', where, - Rank can be any of ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K'] - Suit can be any of ['S', 'H', 'D', 'C'] (Note: Ace 'A' can be counted as high or low in a Flush) ### Parameters - `community_cards` - A list of strings representing the community cards on the table. - `pocket_cards` - A list of strings representing the pocket cards in the player's hand. ### Return Value - Returns `True` if a Flush can be formed by using the community and pocket cards. - Returns `False` otherwise. ### Examples ```python # A Flush can be made with 'Diamonds' check_flush(["A_S", "J_H", "7_D", "8_D", "10_D"], ["J_D", "3_D"]) # True # A Flush can be made with 'Spades' check_flush(["10_S", "7_S", "9_H", "4_S", "3_S"], ["K_S", "Q_S"]) # True # No Flush can be made check_flush(["3_S", "10_H", "10_D", "10_C", "10_S"], ["3_S", "4_D"]) # False ``` ```