add current node to update totalvalue, as the path can start and end at any node
O(k+2) space complexity, current line is generated by the last line
current line generated by the last line
head.right.next = head.next.left
initial work version, a little chaos