Roblox Interview Question

topological sort and trie implementation