I have a list. I am trying to choose specific combinations from that list and making a list of list of those combinations.
My code runs something like this:
n = 6
list = [1,2,3,4,5,6]
n_list = []
for i <- n…1 do
temp_list = List.delete_at(list,i-1)
[temp_list | n_list]
end
So basically i am removing one element at a time adding the resultant list to my list of list. temp_list is getting created correctly in each iteration. However that the end of the for n_list is still empty.