As reported: Adobe SDE-2 (C++) loop (2025), round 2 (C++ basics, OS, then coding): mirror tree.
This is LeetCode 226 — Invert Binary Tree.
Given the root of a binary tree, turn it into its mirror image — swap the left and right children of every node — and return the root.
Example 1
root = [4,2,7,1,3,6,9]
Output: [4,7,2,9,6,3,1]
Example 2
root = [2,1,3]
Output: [2,3,1]
Example 3
root = []
Output: []
Constraints: 0 ≤ number of nodes ≤ 100; -100 ≤ node value ≤ 100.
Code runner format: one JSON value per line: root in level order with null for missing children. Implement invertTree(root); the harness prints the tree in level order.