I have two lists:
A: [[0, 1], [2, [3]], 4]
B: [5, 6, 7, 8, 9]
I wish list B could have the same shape with list A:
[5, 6, 7, 8, 9] => [[5, 6], [7, [8]], 9]
So list A and list B have the same dimension/shape:
A: [[0, 1], [2, [3]], 4]
B: [[5, 6], [7, [8]], 9]
Consider about time complexity, I hope there is a way of O(n) if possible.