← 返回 databricks 的题目列表IP Whitelisting Using CIDR Rules Validator
类型:online_judge
databricks
Design a system to determine if a given IP is allowed based on a set of CIDR rules.
Functional Requirements
isAllowed(ip: str, cidrList: List[str]) -> bool: Input an IP address and a list of CIDR rules, return whether the IP address is allowed.
Data Scale
The CIDR rule list can contain hundreds of rules.
IP address is in standard IPv4 format.
Example
Input
192.168.1.1 ['192.168.0.0/16', '10.0.0.0/8']