Please help me solving this problem. I am not getting any idea how to proceed.
You are given a tree with N nodes and each i'th node has the value a[i] (can be positive as well as negative) . You need to find maximum absolute path sum in the tree with atmost k inversions. In one inversion you can change a negative value to positive and vice — versa.