Go 5ms
\n/**\n * Definition for a binary tree node.\n * type TreeNode struct {\n *     Val int\n *     Left *TreeNode\n *     Right *TreeNode\n * }\n */\n\nfunc levelO
```\n/**\n * Definition for a binary tree node.\n * type TreeNode struct {\n *     Val int\n *     Left *TreeNode\n *     Right *TreeNode\n * }\n */\n\nfunc levelOrder(root *TreeNode) [][]int {\n    var result [][]int\n    \n    customLevelOrder(root, &result, 0)\n    \n    return result\n}\n\nfunc customLevelOrder(root *TreeNode, preResult *[][]int, level int){\n    if root == nil {\n        return\n    }\n    \n    if len(*preResult) == level {\n        *preResult = append(*preResult, []int{})\n    }\n    \n    (*preResult)[level] = append((*preResult)[level], root.Val)\n    \n    customLevelOrder(root.Left, preResult, level + 1)\n    customLevelOrder(root.Right, preResult, level + 1)\n}\n```
['Go']