Pergunta de entrevista da empresa X

It was a coding challenge to solve two questions on IPV4 and IPV6 using C++