Modify the arr [ ] so that the array is sorted in O ( N )
for j in range ( 1000001 ) : NEW_LINE INDENT while ( A [ i ] != 0 ) : NEW_LINE INDENT arr [ j ] = i ; NEW_LINE j += 1 NEW_LINE A [ i ] -= 1 NEW_LINE DEDENT DEDENT