Python | Convert a list of lists into tree-like dict
Given a list of lists, write a Python program to convert the given list of lists into a tree-like dictionary. Examples: Input : [[1], [2, 1], [3, 1], [4, 2, 1], [5, 2, 1], [6, 3, 1], [7, 3, 1]] Output : {1: {2: {4: {}, 5: {}}, 3: {6: {}, 7: {}}}} Input : [['A'], ['B', 'A'], ['C', 'A'], ['D', 'C', 'A']] Output : {'A': {'C': {'D': {}}, 'B': {}}} Meth