... the characters (, ), {, }, [ and ]. Write a function is_valid that checks if the string has valid parentheses.
is_valid