My problem is that I'm trying to remove element from list present in another list.
My list1 looks like this = [[6, 0, 3, 1, 5, 7, 8, 2, 4], [1, 5, 0, 4, 6, 2, 7, 8, 3]]
My list2 looks like this = [[1, 5, 2, 4, 6, 0, 7, 8, 3], [1, 5, 0, 4, 6, 2, 7, 8, 3], [1, 8, 2, 4, 0, 6, 7, 5, 3]]
And I want to continue with list1 which should look like this: [6, 0, 3, 1, 5, 7, 8, 2, 4]
My list2 will always be bigger list, because it saves a states which have been explored or visited. List1 have states that are possible. So an idea is that I want to work with list1 after being popped. I tried something like this:
for x in range(0, len(list2)):
temp = list1[x]
temp_h = temp.init_state
if temp_h in list2:
list1.pop(x)
But this wont work because of out of range index (which I understand). I havent got any ideas how to work with this.