My 1ms Java solution
public class Solution {\n    public List<List<Integer>> levelOrder(TreeNode root) {\n        List<List<Integer>> ll = new ArrayList<>();\n        if(root == nul
    public class Solution {\n    public List<List<Integer>> levelOrder(TreeNode root) {\n        List<List<Integer>> ll = new ArrayList<>();\n        if(root == null)\n            return ll;\n        traversal(ll, root, 1);\n        return ll;\n    }\n    public void traversal(List<List<Integer>> ll, TreeNode node, int depth){\n        if(node == null)\n            return;\n        if(ll.size() == depth - 1) {\n            List<Integer> l = new ArrayList<>();\n            l.add(node.val);\n            ll.add(l);\n        }\n        else if(ll.size() >= depth) {\n            List<Integer> li = ll.get(depth - 1);\n            li.add(node.val);\n        }\n        traversal(ll, node.left, depth + 1);\n        traversal(ll, node.right, depth + 1);\n    }\n}
['Java']