Validate the domain
Given a webpage domain like
www.brilliant.org, your task is to validate it. Make sure that the domain is actually written correctly. The rules of a domain name:
- It can start with
www.or it can have nothing in the beginning
- It should have a name that only has Latin letters (like profound or google)
- It should end with any of
The input contains a single string - the domain.
The program should print
Validin case the domain is valid and
Invalidin case it isn’t.
Time limit: 1 seconds
Memory limit: 512 MB
Output limit: 1 MB