A website domain generally consists of many subdomains, Now the task is to print subdomain name as well as its visit count.
Example : An Input of "1000 google.co.in" means "google.co.in" was visited 1000 times, "google.co.in" have 3 subdomains "in" , "co.in" & "google.co.in" itself . Output for this input must be ["1000 co.in","1000 in","1000 google.co.in"].
You have to find all subdomains with their respective visit count.(Some Domains may have common Subdomains)
Return a list with pair(count & subdomain) for each subdomain.
Example 1:
Input : ["1000 google.co.in"]
Output : ["1000 co.in","1000 in","1000 google.co.in"]
Example 2:
Input : ["150 google.com","200 pepcoding.com","130 contest.pepcoding.com"]
Output : ["480 com","330 pepcoding.com","130 contest.pepcoding.com","150 google.com"]Input Format
Output Format is handled for you.
Output Format
Output Format is handled for you.
Constraints
Notice
Try First, Check Solution later
1. You should first read the question and watch the question video.2. Think of a solution approach, then try and submit the question on editor tab.3. We strongly advise you to watch the solution video for prescribed approach.Example
Input
1 1000 google.co.in
Output
[1000 co.in, 1000 in, 1000 google.co.in]