Pergunta de entrevista da empresa Anthropic

I was given a helper method that does URL crawling. The question is given a domain name and a main URL, parse through all the URLs and get a count of total num of urls that matches the given domain name.