Input: ["ab","adc"] Output: "abd" Expected: "abcd"
In this test-case, how can we derive that c comes before d and after b? Am I missing something?
@coderholic This question's return is problematic. In this case "b < d" is known, "a" and "c"' remain unknown order. But you are required to insert those unknowns to ordered set and still maintain the known order, such as "bdac" or "abcd", they are all valid. Confusing and doesn't make sense to me though.