Given the root of a binary tree, return the level order traversal of its nodes' values (i.e., from left to right, level by level).
root = [3,9,20,null,null,15,7][[3],[9,20],[15,7]]root = [1][[1]]root == null return []; else offer root to queuesz = queue.size() — nodes at the current levelsz nodes: collect values, enqueue non-null childrenres; loop until queue emptyA plain BFS queue mixes nodes from different levels — you can't tell where one level ends. By capturing sz = queue.size() before the inner loop, we freeze the count of nodes at the current level. No matter how many children get enqueued during the inner loop, we always process exactly sz nodes — giving a clean, isolated layer. This is the key insight of iterative BFS level order.