Given a JSON type object, check if parentheses are balanced or not (variant of Valid Parentheses).
Asked in the OA stage. Treat the input as a string containing JSON text, and validate only the bracket characters (), {}, and []. Return true if every opening bracket has a matching closing bracket in the correct order, otherwise return false.
s as a stringdef is_balanced_json_parentheses(s):