Company: Namma yatri_12april
Difficulty: medium
Directory Structure (SDE Question) - Part A Problem Description You are given a directory structure represented as a tree, where each node represents a directory that can have any number of child directories. Each child directory will have a unique name. The second line of the input will contain the root name and its child directories. Based on the given input, you have to construct the directory structure and implement three functions: countDescendants , cutPaste and copyPaste . Example Tree: root / | \ a b c / \ / \ d e f g 1. countDescendants(path) Takes one argument: directory path Returns the number of descendants of the directory Examples: countDescendants("root") => 7 countDescendants("root/a") => 2 countDescendants("root/b") => 0 countDescendants("root/c") => 2 countDescendants("root/d") => 0 countDescendants("root/e") => 0 2. cutPaste(src, dest) It takes two arguments: source directory and destination directory Cuts the source directory from its parent and pastes it inside the