We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I'm passing all but two tests, and failing because of a time limit. My process is that I convert the string into a tree data structure, then I call a function that keeps the tree data structure but each node also has info about it's parent and children values. Then I map the rules onto the nodes (with parent and child info) onto the tree to get the new nodes. My traversal is straight forward. Is this the most efficient outline? I must have efficiency losses somewhere
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
The Tree Of Life
You are viewing a single comment's thread. Return to all comments →
I'm passing all but two tests, and failing because of a time limit. My process is that I convert the string into a tree data structure, then I call a function that keeps the tree data structure but each node also has info about it's parent and children values. Then I map the rules onto the nodes (with parent and child info) onto the tree to get the new nodes. My traversal is straight forward. Is this the most efficient outline? I must have efficiency losses somewhere