Desktop only
Coding Challenges are optimized for Desktop
Come back on a wider screen - the live editor needs room to breathe. You can still read the problem brief above.
Come back on a wider screen - the live editor needs room to breathe. You can still read the problem brief above.
def depth_sum(nested) -> int:
"""Each integer contributes value * depth (top-level depth 1)."""def reverse_depth_sum(nested) -> int:
"""Each integer contributes value * (maxdepth - depth + 1), where maxdepth
is the deepest integer's depth. Compute maxdepth first, then sum."""class NestedIterator:
def __init__(self, nested) -> None: ...
def has_next(self) -> bool: ...
def next(self) -> int: ...