Object-Oriented Programming · Meta · Easy
Write a function that computes a depth-weighted sum over a nested list structure. Before that, you must supply a NestedInteger class that exposes the following three methods: isInteger() — returns true when the object wraps a single integer instead of a nested list. getInteger() — returns the wrapped integer if the object wraps one, and None if it wraps a nested list. getList() — returns the wrapped nested list if the object wraps one, and None if it wraps a single integer.…
Checking your access…