2D List - how to check for values?

I have a hard time using a 1D List to check contents of a 2D List. For example, if I have the following input as 2D int List, and I have a 1D int List that contains all the valid numbers. If it is :
java
//2D List example input
[
[1, 2, -3]
[4,-3,-1]
[3, 1, -2]
]

//1D List example solution
[1,2,-3,4]
java
//2D List example input
[
[1, 2, -3]
[4,-3,-1]
[3, 1, -2]
]

//1D List example solution
[1,2,-3,4]
Is there a way to go through the 2D List, such that I can verify if at least one number in each of the list has a matching number in the solution list? Ie., a -1 in 2D List is false, since solution expects a positive 1. A 2 in 2D List is true, since the solution expects a positive 2. A 3 in the 2D List is false, as solution expects a negative three, ie -3.
So I would want to check for something like the following:
(
((1==1: TRUE) OR (2==2: TRUE) OR (-3==3: FALSE)): TRUE
AND
((4==4: TRUE) OR (-3==-3 TRUE) OR (-1==1: FALSE)): TRUE
AND
((3==-3: FALSE) OR (1==1: TRUE) OR (-2==2: FALSE)): TRUE
): TRUE
(
((1==1: TRUE) OR (2==2: TRUE) OR (-3==3: FALSE)): TRUE
AND
((4==4: TRUE) OR (-3==-3 TRUE) OR (-1==1: FALSE)): TRUE
AND
((3==-3: FALSE) OR (1==1: TRUE) OR (-2==2: FALSE)): TRUE
): TRUE
2 Replies
Kyo-chan
Kyo-chan3y ago
That example of yours is dreadfully unclear
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View

Did you find this page helpful?