You are viewing a single comment's thread. Return to all comments →
Cool recursion. However, this recursion requires O(n) space. You can solve this problem iteratively like this in O(1) space.
From my HackerRank solutions.
Seems like cookies are disabled on this browser, please enable them to open this website
Delete a Node
You are viewing a single comment's thread. Return to all comments →
Cool recursion. However, this recursion requires O(n) space. You can solve this problem iteratively like this in O(1) space.
From my HackerRank solutions.