Elections are going on, and there are two candidates A and B, contesting with each other.
The way this can be done is explained below:1. The voter queue is denoted by three characters, viz {-, A, B}. The - denotes neutral candidate, A denotes supporter of candidate A and B denotes supporter of candidate B. 2. Supporters of A can only move towards the left side of the queue.3. Supporters of B can only move towards the right side of the queue. 4. Since time is critical, supporters of both A and B will move simultaneously. 5. They both will try and influence the neutral voters by moving in their direction in the queue. If supporter of A reaches the neutral voter before supporter of B reaches him, then that neutral voter will become a supporter of candidate A. 6. Similarly, if supporter of B reaches the neutral voter before supporter of A reaches him, then that neutral voter will become a supporter of candidate B. 7. Finally, if both reach at the same time, the voter will remain neutral. A neutral vote cannot decide the outcome of the election.