I am struggling to generate a list of substrings from a given list of strings.
I have a list of domains -
domains = ["abc.pqr.com", "pqr.yum.abc.com"]
Now, for each domain in the list I want to generate subdomains.
For example the subdomains of domain "abc.pqr.com" would be
["pqr.com", "abc.pqr.com"]
Also, for domain "pqr.yum.abc.com" the subdomains would be
["yum.abc.com", "pqr.yum.abc.com", "abc.com"]
So the out put of the method would be -
["yum.abc.com", "pqr.yum.abc.com", "abc.com", "pqr.com", "abc.pqr.com"]