How would you solve the BST pair sum problem with O(1) extra space, and how do you ensure correctness?