Algorithm · OpenAI · Hard
Write a function that accepts an IPv4 starting address start_ip and a positive integer count, and returns the shortest ordered list of CIDR strings that covers precisely the count consecutive addresses beginning at start_ip. The selected blocks must not contain any address before start_ip or after the requested interval. A CIDR string has the shape a.b.c.d/prefix, where prefix is an integer in the inclusive range 0 through 32. A block with prefix $$p$$ represents…
Checking your access…