Algorithm · Salesforce · Medium
You are given a root object that represents a nested structure composed of dictionaries (maps) and arrays (lists). Each dictionary maps a string key to a value that is either a leaf string, another dictionary, or a list. Lists contain zero or more elements, each of which is a leaf string or a dictionary; lists are not nested inside other lists. Your task is to traverse the entire structure without using function recursion. Instead, you must maintain your own explicit stack…
Checking your access…