Problem Statement:You are given an array of objects where each object represents a node. Each node has an id, a name, and a parentId. If the parentId is null, it means the node is the root. Write a function to transform this flat array into a deeply nested tree structure.
Check out your Company Bowl for anonymous work chats.