I have this python code that works perfectly for getting the maximum summation from leaves to root node. My goal is to change this to be the minimum summation instead of the max