Now, each character in B corresponds to a character in begin.
Create a new vector bi of ints, where bi[i] is equal to the index
in begin of the character that corresponds to B[i].
For example,
suppose begin equals "..R.L.RR.". Then B equals "RLRR", and
bi equals { 2, 4, 6, 7 }.