Problem Statement | |||||||||||||
| You are given a String[] words. Return the shortest String that contains all the words as substrings. If there are several possible answers, return the one that comes first lexicographically. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
| - | words will contain between 1 and 12 elements, inclusive. | ||||||||||||
| - | Each element of words will contain between 1 and 50 characters, inclusive. | ||||||||||||
| - | Each element of words will consist of only uppercase letters ('A'-'Z'). | ||||||||||||
Examples | |||||||||||||
| 0) | |||||||||||||
| |||||||||||||
| 1) | |||||||||||||
| |||||||||||||
| 2) | |||||||||||||
| |||||||||||||
| 3) | |||||||||||||
| |||||||||||||
| 4) | |||||||||||||
| |||||||||||||
| 5) | |||||||||||||
| |||||||||||||