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.
- Prepare
- Algorithms
- Dynamic Programming
- Cut Tree
- Discussions
Cut Tree
Cut Tree
Sort by
recency
|
27 Discussions
|
Please Login in order to post a comment
Here is my solution in java, javascript, python, C, C++, Csharp HackerRank Cut Tree Problem Solution
Here is Cut Tree problem solution - https://programs.programmingoneonone.com/2021/07/hackerrank-cut-tree-problem-solution.html
This challenge can be solved in O(n*K*K) time complexity and linear space complexity in my solution, I can't optimize further. My solution to this challenge https://blog.csdn.net/JetHsu1/article/details/131125934
Here is my solution without any dynamic programming. Only single dfs suffice. I challenge hackerrank team to understand it 😜.
Whats wrong in this understadning of solution. https://github.com/PrakashJetty/Solutions/blob/main/Sol10.java
** The idea is to calculate for each node atleast n-k conncted subtrees ** Approach :