NeetCode #471LC-156MediumTrees
← Back to All Problems#471 · #156 · Binary Tree Upside Down(上下翻转二叉树)
📌 Problem Statement & Constraints
Given the root of a binary tree, turn it upside down: the original leftmost path becomes the new left spine, with each original left child becoming a parent whose right child is the original parent. Return the new root. Constraints: the number of nodes is in
[0, 10]; every right node either has a sibling or no children.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!