Possible combinations of rows in a mxn array

There is a m*n array of strings with each row containing part of url. Print all the possible combinations of the rows(url)
Given a sample input similar to the one below

input[3][3] = [{"www","https://www","http://www"},
{"google","adobe","walmart"},
{"com","gov","edu"}]

You need to print all possible combinations of url combining row values-
"www.google.com", "www.google.gov", "www.google.edu","https://www.google.com" and so on.

Comments (0)