Given the root of a binary tree, return its **maximum depth**. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. The tree is represented as a nested object: `{ val, left, right }` where `left` and `right` can be `null`.
Input: root = { val:3, left:{val:9,left:null,right:null}, right:{val:20,left:{val:15,left:null,right:null},right:{val:7,left:null,right:null}} }
Output: 3
Input: root = { val:1, left:null, right:{val:2,left:null,right:null} }
Output: 2