Company: IBM_._
Difficulty: medium
Valid Brackets Problem Description You are given an array of strings, where each string contains only the characters '(', ')', '{', '}', '[', and ']'. For each string, determine if the string is valid. A string is valid if: Every opening bracket has a matching closing bracket of the same type. Brackets close in the correct order. The function isValidBrackets will take one input: string queries[q] : the string queries The function should return an array of strings, where each element is "YES" if the corresponding input string is valid, or "NO" otherwise. Examples Example 1: Input: q = 4 queries = ["(){}[]", "{[}]", "{([])}", "}{()("] Analysis of each bracket sequence: "(){}[]" → All brackets are correctly matched and nested. "{[}]" → Missing closing bracket for '{'. "{([])}" → Brackets are properly nested and matched. "}{()(" → Starts with closing bracket '}' without a match. Output: ["YES", "NO", "YES", "NO"] Explanation: Hence, the answer is ["YES", "NO", "YES", "NO"]. Example 2: Inpu