Medium · Trees · about 10 minutes
Asked at LinkedIn, Amazon, Google, Meta.
Return the largest value in each row (level) of a binary tree, from top to bottom.