If Max is a power of 2 and all array elements are equal
if ( isPower2 and CheckAllEqual ( arr , N ) ) : NEW_LINE INDENT return log2 ( Max ) NEW_LINE DEDENT else : NEW_LINE INDENT return math . ceil ( math . log2 ( Max ) ) + 1 NEW_LINE DEDENT