Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
mask'N'replace solution in Creative category for IP Network: Route Summarization by xndrllyd
def checkio(d):
b=list(map(''.join,(map(lambda x:bin(int(x))[2:].zfill(8),y)for y in map(lambda z:z.split('.'),d))))
h,*t=b
for x in t:
for i,y in enumerate(x):
if y!=h[i]:
h=h[:i]+'x'*len(h[i:])
break
return '.'.join(str(int(x,2))for x in[h.replace('x','0')[i:i+8]for i in range(0,32,8)])\
+f'/{len(h.rstrip("x"))}'
Jan. 28, 2021