Consider a 5 X 5 input - A :
A = a & a.
For each set bit in A we can conclude that the respective bit is also set in a and a.
Similarly, from A,A and A we can get all the set bits of A.
The best way to calculate the set bits in A is to perform OR operation on the first row (except A).
Consider the kth bit of A :
If it is not set (0) : then the kth bit of all the elements of the first row will be unset. Thus after doing OR the kth bit will remain unset.
If it is set (1) : then the kth bit of at least one of the elements of the first row hast to be set. Thus, after doing OR, the kth bit will be set(speciality of OR).
Contradiction : -1 5 5 5 5(only first row)
here after doing OR , A = 5 = 0101
but A can be 13(1101), *29(11101), larger value…
Since, we are required to calculate the minimum value of A, 5 will work.
Similar proof can be done for all rows.
Hope it is clear.