Algorithm · Amazon · Medium
You are handed a mapping that stands in for a directory tree on disk, where nested folders and files are represented by plain Python values. Build a function that walks the whole tree from its root, examines every regular file it encounters, collects the valid IPv4 addresses that appear anywhere in the readable contents, and hands back the distinct addresses sorted in lexicographic (string) order. An IPv4 address is regarded as valid only when it consists of exactly four…
Checking your access…