I have two arraylists: a1 = {1, 0, 0, 1, 0, 0,} and a2 = {0, 1, 1, 0, 0, 0}. I need to compare the elements of both the arraylists so I can come up with a3 = {1, 1, 1, 1, 0, 0}.
a3 is based on the Logical disjunction operation where it produces a value of true if at least one of its operands is true.
need help here…
Probably there could be better solutions, but the following should work for you:
Output: