taking a list of integers and duplicating all elements in it while keeping order; no auxiliary structures available
eg: [1,2,3,] becomes [1,1,2,2,3,3]
this is my approach:
def stutter_list(lst):
if not lst:
return
tmp = lst.pop()
lst.append(tmp)
lst.append(tmp)
stutter_list(lst[:-2])```
im thinking i pop the last element in the list, append it twice because the goal is change the parameter of the list given(would the verb for mutable be mutate), and then recursively call the function without the last two elements