Let's say I have the following two arrays:
int[] a = [1,2,3,4,5]; int[] b = [8,1,3,9,4];
I would like to take the first value of array a - 1 - and see if it is contained in array b . So, I would understand that the “1” from a is in b , even if it is not in the same position. When I compare the first element in a , I will go to the next number in array a and continue the process until I completely go through the first array.
I know that I need to make a loop (perhaps nested?), But I can’t understand how I stick to only the first number in array a , sorting through all the numbers in array b .
It seems pretty simple, I just can't hug it around ...
source share