Company: oracle_16oct
Difficulty: medium
Code Bracket Validator Problem Description A code editor wants to flag lines whose brackets do not line up. You are given an array of strings queries . Every string is made only of the six bracket characters ( , ) , [ , ] , { and } , and a string may also be empty. For each string, decide whether it is valid . A string is valid when both of the following hold: Every opening bracket has a matching closing bracket of the same type. Brackets close in the correct order: a closing bracket must match the most recent opening bracket that is still unclosed. In other words, no closing bracket may appear without an earlier unclosed opening bracket of its own type to pair with, two pairs may nest but never cross, and no opening bracket may be left unclosed at the end. The empty string is valid. Complete the function isValidBrackets(queries) . It receives the array queries and returns an array of strings of the same length, whose i -th element is "YES" if queries[i] is valid and "NO" otherwise. Th