Hi all,
I have created 3 arrays which can have common elements in each like-
arr_a contains str1 str2 str3 str4 str5
arr_b contains str3 str6 str7 str1 str8
arr_c contains str4 str9 str10 str2
each array is created with "set -A arr_name values" command. I want to create a resultant array-say arr_a, which will contain the merging of the above 3 arrays without any duplicate elements like-
arr_a str1 str2 str3 str4 str5 str6 str7 str8 str9 str10
I can merge the array with the same 'set -A arr_a ${arr_a[]} ${arr_b[]} ${arr_c[*]}' command, however it contains duplicate elements. Is ther any option i can provide with 'set' to create array with unique elements??
Considering looping is not the right option as the time complexity will directly proportional to the total elements in individual array. So please consider this while providing input.
thanks in advance for the replies.