private static <T> Pair<BinaryTree<T>, Integer> find_non_k_balanced_node_helper(
            BinaryTree<T> n,
            int k) {
        // Empty tree.
        if(n == null) {
            return new Pair<BinaryTree<T>, Integer>(null, 0);
        }

        // Early return if left subtree is not k-balanced.
        Pair<BinaryTree<T>, Integer> L = find_non_k_balanced_node_helper(n.getLeft(), k);
        if(L.getFirst() != null) {
            return L;
        }
        // Early return if right subtree is not k-balanced.
        Pair<BinaryTree<T>, Integer> R = find_non_k_balanced_node_helper(n.getRight(), k);
        if(R.getFirst() != null) {
            return R;
        }

        int node_num = L.getSecond() + R.getSecond() + 1; // # of nodes in n.
        if(Math.abs(L.getSecond() - R.getSecond()) > k) {
            return new Pair<BinaryTree<T>, Integer>(n, node_num);
        }
        return new Pair<BinaryTree<T>, Integer>(null, node_num);
    }