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.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Hiring developers?
  1. Prepare
  2. Functional Programming
  3. Recursion
  4. The Tree Of Life
  5. Discussions

The Tree Of Life

Problem
Submissions
Leaderboard
Discussions
Editorial

    You are viewing a single comment's thread. Return to all comments →

  • aryzach
    3 years ago+ 1 comment

    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

    1|
    Permalink
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy