Find Maximum number of bits required in the binary representation of maximum number so log2 is calculated
if ( arr [ i ] > itr ) : NEW_LINE INDENT itr = arr [ i ] NEW_LINE DEDENT p = int ( log2 ( itr ) ) + 1 NEW_LINE