I've got an assignment in which I need to code a recursive function (with no loops) in Python that returns:
[[]]
if n is 1[[],[[]]]
if n is 2[[],[[]],[[],[[]]]]
if n is 3
A pseudo code or a hint would be really appreciated.
My current code which I'm working on:
def ezr(n,a,b):
a.append(b)
b= deepcopy(a)
return ezr(n-1,a,b)
def magic_list(n):
return ezr(n,[],[])
I'm stuck with the first function.