- Problem Statement.
- A
**main()**with the examples compiled in. - A skeleton that compiles with
**main.cpp**. -
**Problem Given in Topcoder**: July, 2013 -
**Competitors who opened the problem**: 787 -
**Competitors who submitted a solution**: 778 -
**Number of correct solutions**: 577 -
**Accuracy (percentage correct vs those who opened)**: 73.3% -
**Average Correct Time**: 15 minutes, 53 seconds.

Consider the following points:

- Since the L's and R's can't cross each other, if you strip the dots from
**begin**and**target**, they should equal each other. So, create two strings:**B**, which is**begin**without the dots and**T**, which is**target**without the dots. If**B**doesn't equal**T**, return "Impossible." That will help you write code later that does not seg fault. - 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 }. - Create
**ti**, which is like**bi**, only for**target**and**T**rather than**begin**and**B**. - Can you see how to finish the problem using
**B**,**bi**and**ti**? If you can't see it, write out a bunch of examples. Make some up of your own.