Medium · Trees
Is complete
Given the root of a binary tree, return true if it is complete (every level except possibly the last is completely filled, and the last level's nodes are as far left as possible) and false otherwise. An empty tree is complete.
Examples
Example 1
[1,2,3,4,5,6] → completeOutput: true
Example 2
[1,2,3,4,null,null,7] → notOutput: false
Rebuild it in the studio
Open every published interview problem, solution, scene, and memory room free, with no account.