Company: Amazon_july
Difficulty: medium
Find Longest Regex Problem Description Amazon developers are building a prototype for a regex generator for the given strings. For the prototype version, the regex consists of uppercase English letters, '[' and ']'. Here, a string of characters enclosed in square brackets '[' and ']' matches any of the one characters in that string. Also, the string of characters enclosed within '[' and ']' consists of uppercase English letters only with no repetition. For example, "[ABBRJAABC]" is not a valid regex as B occurs twice between square brackets. "[JABC", "[A]I]", "[J]" and "AABC" are also not valid regexes as brackets must contain some string, and brackets should also form a balanced bracket sequence. "[ABC][BCA]" is a valid regex and matches with "BBCA" and "ABCA", but not with "ABBCA". "[ABCZ][Q]" is a valid regex and matches with "AQ", "BQ", "CQ", "ZQ" but not with "DQ" or "ZC". "[A][B][C][D]" is a valid regex and matches only with the string "ABCD". Given 3 strings x, y, and z of lengt