Given a list of ALLOW and DENY CIDR rules, determine whether an IP address is allowed or denied.
Unlock detailed company stats for this questionUpgrade
Implement access_ok(rules, ip_address) that returns true or false, and print the index of the rule that allowed or denied the IP. If none of the rules match, deny it.
Example rules: {"ALLOW", "192.168.100.0/24"} {"DENY", "192.168.0.5/30"} {"ALLOW", "192.168.1.1/22"} {"ALLOW", "1.0.0.0/8"} {"ALLOW", "2.3.4.9"} {"DENY", "8.8.8.8/1"} {"ALLOW", "5.6.7.8"}
Community answers
No answers contributed by the community yet.
Related courses

Course

Course
Course
