Medium
Given the root of a binary tree, return an array containing the largest value in each row (level), ordered from the top row to the bottom row.
root
Input: root = [1,3,2,5,3,null,9] Output: [1,3,9]
Input: root = [1,2,3] Output: [1,3]