Python | Add list elements with a multi-list based on index
Given two lists, one is a simple list and second is a multi-list, the task is to add both lists based on index. Example: Input: List = [1, 2, 3, 4, 5, 6] List of list = [[0], [0, 1, 2], [0, 1], [0, 1], [0, 1, 2], [0]] Output: [[1], [2, 3, 4], [3, 4], [4, 5], [5, 6, 7], [6]] Explanation: [1] = [1+0] [2, 3, 4] = [0+2, 1+2, 2+2] [3, 4] = [3+0, 3+1] [4