0 based index system
int index = pos ; update_BITree ( index , str . charAt ( index ) , - 1 ) ; str = str . substring ( 0 , index ) + s + str . substring ( index + 1 ) ; update_BITree ( index , s , 1 ) ; }