LeetCode: Binary Tree Level Order Traversal C#
Avoid unnecessary variables

The counter variable is unnecessary.
For each level, you need just a List&lt;int&gt; level,
add the elements of the level to this list,
and then add this list to res.

By eliminating this variable, you also eliminate any concerns about the correctness of res[counter].Add(temp.val);.
With the code changed to level.Add(temp.val),
the mental burden is reduced.

Use more descriptive names


res could be levels
temp could be node
LevelOrder could be GetLevels
BinaryTreeLevelOrderTraversalClass would be better without Class