#21 isIPv4Address
題目 : An IP address is a numerical label assigned to each device (e.g., computer, printer) participating in a computer network that uses the Internet Protocol for communication. There are two versions of the Internet protocol, and thus two versions of addresses. One of them is the IPv4 address.
Given a string, find out if it satisfies the IPv4 address naming rules.
範例 :
For inputString = "172.16.254.1", the output should be solution(inputString) = true;
For inputString = "172.316.254.1", the output should be solution(inputString) = false;
解法 :