class Solution {
public static List<Integer> res;
public List<Integer> inorderTraversal(TreeNode root) {
res = new ArrayList<>();
dfs(root);
return res;
}
public void dfs(TreeNode root) {
if (root == null) return;
dfs(root.left);
res.add(root.val);
dfs(root.right);
}
}