I have two arrays that I want to loop through. Array A and Array B. I want to add the elements of both array into a new Array that contains the collection of all elements in that array without any duplication. This will be written in python.
For Example
A = [1,2,3,4]
B = [1,5,6,7]
Collection = [1,2,3,4,5,6,7]
I was wondering if there's a faster and more efficient to do it without looping through each indexes and comparing it and then storing it. Because that's what I'm planning to do but I think it will take really long time given that I have about a couple thousand elements in each array.