Design a function depth_map which returns a dictionary whose keys are the depths of the items in and the value for a given key is a list of the items at that depth. The depth of an object in a nested list is the number of nested lists,enclosing the object. The depth of a single int is 0. If no items occur at a given depth, that key should not appear in the dictionary. Use function design recipe and you MUST USE RECURSION to solve the problem. this is my assignment and it's really confusing and I also can't find a way to solve it.
depth_map([19, [[22]], [-3, [8], 47]]) output ->{1: [19], 3: [22, 8], 2: [-3, 47]}