Question
comparing contents between two arrays
Hi. I've tried to find this on my own, but have not had much
luck, so I hope somebody can help me out.
I have 3 arrays. All three have a set of numbers(integers) in it.
1. Is there a way to compare arrayA with arrayB to see if there are any matching numbers between the two of them? They don't have to be at the same index number, just anywhere within the arrays. ?
2. And then, if there are matching numbers, take that number(s) and see if it exists anywhere within a third array (arrayC). If it does, then I want to swap out that number from the third array and replace it with something else. I think I know how to do the swapping, I'm just not sure how to capture that value from the first step.
Thank you very much for any help you can give me.
--cindy
I have 3 arrays. All three have a set of numbers(integers) in it.
1. Is there a way to compare arrayA with arrayB to see if there are any matching numbers between the two of them? They don't have to be at the same index number, just anywhere within the arrays. ?
2. And then, if there are matching numbers, take that number(s) and see if it exists anywhere within a third array (arrayC). If it does, then I want to swap out that number from the third array and replace it with something else. I think I know how to do the swapping, I'm just not sure how to capture that value from the first step.
Thank you very much for any help you can give me.
--cindy