Back to problems

Design IP Range Iterator

Algorithm · OpenAI · Easy

Problem Every device on the public Internet has an IPv4 address, conventionally written in dotted-decimal notation as "A.B.C.D" where A, B, C, and D are integers between 0 and 255. Together these four octets represent a single 32-bit unsigned integer. Your task is to build a forward-only iterator that yields every IP address from a given starting point through the absolute maximum of 255.255.255.255. Implement the IPv4Iterator class: IPv4Iterator(String startIp) Initializes…

Checking your access…