Skip to content

Latest commit

 

History

History
13 lines (10 loc) · 430 Bytes

File metadata and controls

13 lines (10 loc) · 430 Bytes

Problem 12: Syntactic Address Validation (Valid IP Address)

Problem Statement

Given a string queryIP, return "IPv4" if IP is a valid IPv4 address, "IPv6" if IP is a valid IPv6 address or "Neither" if IP is not a correct IP of any type.

Input Format

  • A string queryIP.

Example

Input: queryIP = "172.16.254.1"
Output: "IPv4" Input: queryIP = "2001:0db8:85a3:0:0:8a2e:0370:7334"
Output: "IPv6"