Algorithm · Verkada · Medium
You have a filesystem represented as a tree of nodes, where each node is either a directory or a file. The tree's root is given as root (guaranteed non‑null). Your job is to walk through the entire tree, examine every file's content (lines of text), and collect all valid IPv4 addresses that appear in those lines. Return a list of the distinct addresses, sorted in ascending lexicographic order. Each node conforms to the class below: If isFile is true, the node is a file: its…
Checking your access…