':type root: TreeNode
:type k: int
:rtype: bool'

def findTarget(self, root, k):

    class BSTIterator(object, ):
        def __init__(self, root, forward):
            self.__node = root
            self.__forward = forward
            self.__s = []
            self.__cur = None
            self.next()
        def val(self):
            return self.__cur
        def next(self):
            while (self.__node or self.__s):
                if self.__node:
                    self.__s.append(self.__node)
                    self.__node = (self.__node.left if self.__forward else self.__node.right)
                else:
                    self.__node = self.__s.pop()
                    self.__cur = self.__node.val
                    self.__node = (self.__node.right if self.__forward else self.__node.left)
                    break
    if (not root):
        return False
    (left, right) = (BSTIterator(root, True), BSTIterator(root, False))
    while (left.val() < right.val()):
        if ((left.val() + right.val()) == k):
            return True
        elif ((left.val() + right.val()) < k):
            left.next()
        else:
            right.next()
    return False
