Royal Match: Wombo Combo

Sign in to test your solution.
def royal_match_wombo_combo(matrix):