Finding column - wise prefix count
for i in range ( bitscount ) : NEW_LINE INDENT for j in range ( 1 , n ) : NEW_LINE INDENT for k in range ( n ) : NEW_LINE INDENT prefix_count [ i ] [ j ] [ k ] += prefix_count [ i ] [ j - 1 ] [ k ] NEW_LINE DEDENT DEDENT DEDENT