623. Add One Row to Tree

    [LeetCode] 623. Add One Row to Tree

    [LeetCode] 623. Add One Row to Tree

    623. Add One Row to Tree Medium Given the root of a binary tree and two integers val and depth, add a row of nodes with value val at the given depth depth. Note that the root node is at depth 1. The adding rule is: Given the integer depth, for each not null tree node cur at the depth depth - 1, create two tree nodes with value val as cur's left subtree root and right subtree root. cur's original..