You are given a array of strings A of length N.
You have to return another string array which contains all possible special strings in Lexicographic order.
A special string is defined as a string with length equal to N,
and ith character of the string is equal to any character of the ith string in the array A.
A = ['ab', 'cd']
A = ['aa', 'bb']
['ac', 'ad', 'bc', 'bd']
['ab', 'ab', 'ab', 'ab']
Since, the first character has to be from the 1st string 'ab' and the 2nd from 'cd'. These are the all possible 4 combinations.
Note we can have duplicate strings, you have to add all of them.
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a question? Checkout Sample Codes for more details.