def literal_check(model_generated_answer: str, ground_truth: str) -> Union[bool, None]:
    """
    Check if two strings are the same character by character
    """
    model_remove = (
        deepcopy(model_generated_answer)
        .replace(",", " ")
        .replace(" ", "")
        .replace(" ", "")
    )
    gt_remove = (
        deepcopy(ground_truth).replace(",", " ").replace(" ", "").replace(" ", "")
    )

    if model_remove == gt_remove:
        return True

    if (
        has_numbers(model_generated_answer) == False
        and has_numbers(ground_truth) == False
    ):
        model_generated_answer = model_remove.strip("[]() ")
        ground_truth = gt_remove.strip("[]() ")
        if model_generated_answer == ground_truth:
            return True

    return None

    Check if two strings are the same character by character
    
envs/rstar/eval_src/toolkit_for_MATH/latex_answer_check.py