Write a solution to validate an IPv4 address.
IPv4 addresses are canonically represented in dot-decimal notation, which consists of four decimal numbers, each ranging from 0 to 255, separated by dots, e.g., 172.16.254.1
For valid IPv4 addresses return
true and for invalid addresses return
Below are some valid IPv4 addresses:
Below are some invalid IPv4 addresses: