<p>Some robots are standing on an infinite number line with their initial coordinates given by a <strong>0-indexed</strong> integer array <code>nums</code> and will start moving once given the command to move. The robots will move a unit distance each second.</p>
<p>You are given a string <code>s</code> denoting the direction in which robots will move on command. <code>'L'</code> means the robot will move towards the left side or negative side of the number line, whereas <code>'R'</code> means the robot will move towards the right side or positive side of the number line.</p>
<p>If two robots collide, they will start moving in opposite directions.</p>
<p>Return <em>the sum of distances between all the pairs of robots </em><code>d</code><em>seconds after the command. </em>Since the sum can be very large, return it modulo <code>10<sup>9</sup> + 7</code>.</p>
<p><b>Note: </b></p>
<ul>
<li>For two robots at the index <code>i</code> and <code>j</code>, pair <code>(i,j)</code> and pair <code>(j,i)</code> are considered the same pair.</li>
<li>When robots collide, they <strong>instantly change</strong> their directions without wasting any time.</li>
<li>Collision happens when two robots share the same place in a moment.
<ul>
<li>For example, if a robot is positioned in 0 going to the right and another is positioned in 2 going to the left, the next second they'll be both in 1 and they will change direction and the next second the first one will be in 0, heading left, and another will be in 2, heading right.</li>
<li>For example, if a robot is positioned in 0 going to the right and another is positioned in 1 going to the left, the next second the first one will be in 0, heading left, and another will be in 1, heading right.</li>
</ul>
</li>
</ul>
<p> </p>
<p><strongclass="example">Example 1:</strong></p>
<pre>
<strong>Input:</strong> nums = [-2,0,2], s = "RLL", d = 3
<strong>Output:</strong> 8
<strong>Explanation:</strong>
After 1 second, the positions are [-1,-1,1]. Now, the robot at index 0 will move left, and the robot at index 1 will move right.
After 2 seconds, the positions are [-2,0,0]. Now, the robot at index 1 will move left, and the robot at index 2 will move right.
After 3 seconds, the positions are [-3,-1,1].
The distance between the robot at index 0 and 1 is abs(-3 - (-1)) = 2.
The distance between the robot at index 0 and 2 is abs(-3 - 1) = 4.