The bi#ch of the problem is that, as posed, he is looking for 2 out of N.
N could be a very large number!
So, the real quest is... how to determine 2 out of N (a potentially very large number) in a single scan?
If this were a nuclear melt-down, or a space-craft landing on the moon, you would want to know the answer really quick, wouldn't you? Especially in terms of critical decisions that are based on the milli-second.
It could be done very easily with a special-function or sub-routine with jumps... however, as far as I'm concerned (and, I would expect, with any of the other purists that might be around), the challenge is to make the determination in ladder-code, or function-block-code, or STL-type-code, in a single scan, with a minimum number of rungs or function-blocks. That is... make the determination, as fast as possible, without affecting scan-time... at least, without affecting scan-time too much.
It occurs to me, although I might be wrong - believe it or not, that this should be determinable with AND-OR-NOT-NOR-XOR logic in only a rung or two (maybe three... or four). I'm still working on it.
Again, this is an interesting problem.