Increment count of numbers having MSB at log ( arr [ i ] )
if ( freq . containsKey ( ( int ) ( Math . log ( arr [ i ] ) ) ) ) freq . put ( ( int ) ( Math . log ( arr [ i ] ) ) , ( int ) ( Math . log ( arr [ i ] ) ) + 1 ) ; else freq . put ( ( int ) ( Math . log ( arr [ i ] ) ) , 1 ) ; }