Programming challenge description:

A network block is defined by an IP address and a subnet mask. The mask value separates the network address from the internal address based on how many bits are hidden by the mask.
For example, an 8-bit subnet mask is expressed as An IP address of with that mask applied reveals a network address of

Your challenge is to inspect an IP address and mask number, then decide if another IP address is on that local network.
Considering the IP block and a subnet mask of, we can represent this like so: (this is called CIDR notation).

As an example, the address would be on the local network. The address would not.
Explanation: CIDR notation means that 8 most significant bit are fixed and rest of 24 bits are available to use for IP addresses so here 10 is fixed as it lies on first 8 bits but other 3 places (which lie on rest of 24 bits) in doted notation can have any value between 0-255 so any address like is on this network but address like is not valid on this network because we cannot have 12 at first place only 10 is allowed.

As another example if we have, it means 12 most significant bits are fixed and rest of 20 bits are free for change so here 172 is fixed because it is on first 8 fixed bits but from next 8 bits only first 4 bits are fixed so at second place we can have any value from 16-255, on 3rd and 4th place nothing is fixed so we can use any value between 0-255.

Three lines of input as follows:
IPv4 Network block in standard CIDR notation
IPv4 Address to Check
If the IP address is in the subnet defined by the CIDR, print “True”. Otherwise, print “False”.

Test 1
Test Input

Expected Output

Test 2
Test Input

Expected Output

Test 3
Test Input

Expected Output