You are given the root of a binary tree, return the total number of nodes in the tree.
root
6
The tree has 6 nodes: 1, 2, 3, 4, 5, 6.
1
The tree consists of a single root node.
None
0
An empty tree has no nodes.
Hello! I am your ✨ AI assistant. I can provide you hints, explanations, give feedback on your code, and more. Just ask me anything related to the problem you're working on!