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 destination directory
Example: cutPaste("root/a", "root/c")
3. copyPaste(src, dest) - It takes two arguments: source directory and destination directory - Copies the source directory and pastes it into the destination
Example: copyPaste("root/a","root/c")
Output: - countDescendants(node): print the total number of descendants or "Invalid command" - cutPaste(src, dest): print "OK" or "Invalid command" - copyPaste(src, dest): print "OK" or "Invalid command"
Negative Conditions: - If the source is an ancestor of the destination, print "Invalid command" - If source = destination, print "Invalid command" - If the destination already has a directory of the source's name, print "Invalid command" - If not a valid path for the source or destination, print "Invalid command" - If command causes total nodes > 10^6, print "Invalid command"
Input Bounds: - 1 <= n <= 10^5 (structure lines) - 1 <= q <= 10^5 (commands) - Total number of nodes at any point: <= 10^6