Approach hintTry it first, then revealHide
Every value is below 2^9, so try each candidate answer A from 0 upwards. A is feasible when every a_i has some b_j for which a_i & b_j is a submask of A; the first feasible A is optimal.
Every value is below 2^9, so try each candidate answer A from 0 upwards. A is feasible when every a_i has some b_j for which a_i & b_j is a submask of A; the first feasible A is optimal.