def match_feature(pairs, feature_mapping):
    """ 
    Match the pairs of cards on it's group_id. Based on symbol_mapping or shades_mapping.
    ex. match 'a' -> [{'a', 'A', '@'}, {'h', 'H', '#'}, {'s', 'S', '$'}]
    should get 'a' in the first sets. so the group_id should be '0'.
    :params: pairs - list of cards
    :params: feature_mapping - Either symbol_mapping or shades_mapping.
    :return: match_result - list of int (group_id)
    """
    match_result = []
    for color, feature in pairs:
        for index, group in enumerate(feature_mapping):
            if feature[0] in group:
                match_result.append(index)
                break
    return match_result