Write an algorithm to find and remove the minimum number of invalid parentheses to make an input string valid.
Implement def min_remove_to_make_valid(s):, where s is a string containing lowercase letters and parentheses. Return a valid string formed by deleting the fewest parentheses while preserving the relative order of all remaining characters. If multiple valid results are possible, return any one of them.
def min_remove_to_make_valid(s):