Coding Challenge · BEGINNER
A genealogist is analyzing a family tree and wants to group family members by generation. Given the root of a binary tree representing the family tree, return a list of lists where each inner list contains the values of the nodes at each generation, starting from the oldest ancestor.