Object-Oriented Programming · Databricks · Medium
Encrypt Every File in a File-System Tree Problem Overview Model a file system as a tree containing two node types: DirectoryNode stores a children list. Each child may be a DirectoryNode or a FileNode, in any mixture. FileNode stores a Boolean field named is_encrypted. There are two parts to this problem. Part 1: Count Encrypted and Unencrypted Files Implement a function that receives a DirectoryNode, visits every node in its subtree, and returns (encrypted_count,…
Checking your access…