Deepest leaves lowest ancestor

Write codeMedium30 min

Your task

Given a binary tree as a level-order list (None marks a missing child; children of None are omitted), return the VALUE of the lowest common ancestor of the set of deepest leaves (the leaves at maximum depth). If there is one deepest leaf, return that leaf's value. For an empty tree return None. All values are distinct.

Examples

lca_deepest_leaves(level: list) -> int
Example 1
Inputlca_deepest_leaves([3, 5, 1, 6, 2, 0, 8, None, None, 7, 4])
Output2