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 had the same problem as you. All my tests were passing except for a runtime error on test case #12.
If you look at some of the other posts in this discussion, someone else points out in this comment that the HackerRank machines are running out of space because you're creating too many Nodes.
As he point out, you can greatly reduce the number of Nodes created by storing multiple letters in a single node, and then expanding it only when necessary.
I created this solution and it makes the Runtime Error go away:
Tries: Contacts
You are viewing a single comment's thread. Return to all comments →
I had the same problem as you. All my tests were passing except for a runtime error on test case #12.
If you look at some of the other posts in this discussion, someone else points out in this comment that the HackerRank machines are running out of space because you're creating too many Nodes.
As he point out, you can greatly reduce the number of Nodes created by storing multiple letters in a single node, and then expanding it only when necessary.
I created this solution and it makes the Runtime Error go away:
I hope that helps!