+ import std.math; import std.typecons; - import std.math; /* - - You are given an array of two strings, both strings consist of open ? ---- + You are given an array of two strings, both strings consist of open - parentheses '(' or close parentheses ')' only. ? ---- + parentheses '(' or close parentheses ')' only. - Your job is to check if it is possible to concatenate the two strings in ? ---- + Your job is to check if it is possible to concatenate the two strings in - some order, that the resulting string will be good. ? ---- + some order, that the resulting string will be good. - A string S is considered to be good if and only if all parentheses in S ? ---- + A string S is considered to be good if and only if all parentheses in S - are balanced. For example: the string '(())()' is good, while the string ? ---- + are balanced. For example: the string '(())()' is good, while the string - '())' is not. ? ---- + '())' is not. - Return 'Yes' if there's a way to make a good string, and return 'No' otherwise. ? ---- + Return 'Yes' if there's a way to make a good string, and return 'No' otherwise. - - Examples: ? ---- + Examples: - >>> match_parens(["()(", ")"]) ? ---- + >>> match_parens(["()(", ")"]) - "Yes" + "Yes" - >>> match_parens([")", ")"]) ? ---- + >>> match_parens([")", ")"]) + "No" - "No" - */ string match_parens(string[] lst)