In your example would you get a triplicate without the AND?
You would.
If Array(x) = Array(y) then <--- This line checks to see if we have a duplicate first.
Duplicate = Array(x)
IF Array(x)=Array(y+1) then Tripiplicate = Array(x) <--- And only if we have a duplicate can we check to see if it's a triplicate.
END IF
Look at your code for a brief moment:
If
Array(x) = Array(y) then Duplicate = Array(x)
or IF
Array(x) = Array(y) and Array(x)=Array(y+1) then Tripiplicate = Array(x)
Notice how the conditions are *exactly* the same for the portions I colored? Those lines can be simplified so that a single IF checks for their condition, with sub-conditions coming inside the main if.
Think of it as:
IF x >0 AND x < 4 THEN PRINT "I"
IF x > 0 AND x < 3 THEN PRINT "I"
IF X > 0 and X < 2 THEN PRINT "I"
The above is a simple Roman Numeral printer for values from 1 to 3, but it's got a total of 6 IF checks to pass before it goes on past this segment of code. The exact same thing can be simplified by nestled IF structuring:
IF x > 0 Then 'Every condition needs x to be greater than 0
IF x < 4 then Print "I"
IF x < 3 then Print "I"
IF x < 2 then PRINT "I"
END IF
Now there's only a total of 4 IF checks to pass, and the results will be exactly the same. ;)
When you have segments that contain the exact same conditions to operate, it's often simplest to merge them together under one blanket nestled condition.