change string into vector add function cnt_L2R & cnt_R2L