The key observation is if there is at least one dissimilar number in a group their AND will be zero. Let AfmaxA_{fmax} be the maximum frequent element and AfcA_{fc} be the maximum frequent element count and SS be the summation of all the array elements.

  1. If

  2. If $N/2<Afc<N\lfloor N/2 \rfloor < A_{fc} < N,answer is \lfloor N/2 \rfloor < A_{fc}$)*A_{fmax}

Statistics

46% Solution Ratio
NirjhorEarliest, Jun '22
steinumFastest, 0.0s
steinumLightest, 5.5 kB
steinumShortest, 675B
Toph uses cookies. By continuing you agree to our Cookie Policy.