Again traverse the array and find the actual counts .
for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] == first ) count1 ++ ; else if ( arr [ i ] == second ) count2 ++ ; } if ( count1 > n / 3 ) { Console . Write ( first + " ▁ " ) ; flag = 1 ; } if ( count2 > n / 3 ) { Console . Write ( second + " ▁ " ) ; flag = 1 ; } if ( flag == 0 ) Console . Write ( " No ▁ Majority ▁ Element " ) ; }