Given the root of a binary tree, return an array of the largest value in each row of the tree.The solution involves traversing all levels of the binary tree to identify the largest value at each level.The most straightforward approach to finding the largest value in each row is using BFS or DFS.Implementing this solution in PHP involves using a queue for BFS traversal and maintaining an array of the largest values for each row.