Algorithm · Google · Medium
Nested List Weight Sum Medium · Topics · Company Tags · Hints You are given a string that represents a nested list of integers. The encoding follows these rules: the string starts with [ and ends with ], integers are separated by commas, and sublists are also delimited by [ and ]. Every integer is a contiguous sequence of digits, possibly with a leading minus sign. You may ignore spaces. Compute a weighted sum of every integer in the structure. The outermost level…
Checking your access…