Marks :100
: 0 | : 0
Pairtel company is given the contract to assign Ip addresses to the computers of HackerEarth.The printer used to print the set malfunctioned and some of the addresses were wrongly printed.
Check the validity of each address. Return "IPv4" If IP is a valid Ipv4 Address, "IPv6" If P is a valid IPv6 address or "Invalid" If IP is not a correct IP of any type.
The first line contains a string denoting the IP addresses
For each test print the type of IP address
192.168.0.1
IPv4
A valid IPv4 address is an IP in the form "x1.x2.x3.x4" where ($$$0 \le xi \le 255$$$) and xi cannot contain leading zeros.
A valid IPv6 address is an IP in the form "x1 : x2 : x3 : x4 : x5 : x6 : x7 : x8" where:($$$1 \le i.length \le 4$$$) xi is a hexadecimal string which may contain digits, lower-case English letters ('a' to 'f') and upper-case English letters ('A' to 'F').
Leading zeros are allowed in xi.
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.