#T309. 括弧匹配检验
括弧匹配检验
Description
Assume an expression can contain two types of brackets: parentheses () and square brackets [], which can be nested in any order. For example, ([ ]()) or [([ ][ ])] are correctly matched, while [( ]) or ([ ]( or (( ) ) ) are incorrectly matched. The problem now is to check whether the brackets in a given expression are correctly matched.
Given a string containing only parentheses and square brackets, determine if the brackets in the string are matched. If they are matched, output "OK"; otherwise, output "Wrong". For example, if the input string is [([][])], the output should be "OK".
Input Format
The input consists of a single line of characters (the number of characters is less than 255).
Output Format
If the brackets are matched, output "OK"; otherwise, output "Wrong".
[(])
Wrong