Snowden as we all know is good at stealing and parsing the resources from the internet. He has been threatened by the intelligence agencies to find our parliamentary members for surveillance in one day time. The data would be safe if we are able to collect all the links in a site before him. So our goal is given a webpage source we have to extract all the links going to the same site.
A link will look like this
Note :
The order of links need to be preserved.i.e. the document needs to be scanned from left-right top-bottom fashion.
Input :
The First line is the website name.
Followed by the html content that ends with the string “exit” in a new line.
1 <= Length of each line <= 500
1 <= total number of lines <= 25
Output:
Output all the links that links to the same site.
The first Two links, links to the same site www.knowyoucandidate.net whereas the next two links will go to facebook.com and plus.google.com