There are dominoes of length
'L' indicates that the domino is pushed to the left.
'R' indicates that the domino is pushed to the right.
'.' indicates that the domino is standing upright and has not been pushed.
At each second, every domino falling to the left pushes the adjacent domino directly to its left, and every domino falling to the right pushes the adjacent domino directly to its right. If an upright domino is pushed from both sides simultaneously, it remains upright due to the balance of forces.
Return a string representing the final state of the dominoes after all movement has ceased.
Constraints:
dominoes.length
dominoes[i] is either 'L', 'R', or '.'.
There are dominoes of length
'L' indicates that the domino is pushed to the left.
'R' indicates that the domino is pushed to the right.
'.' indicates that the domino is standing upright and has not been pushed.
At each second, every domino falling to the left pushes the adjacent domino directly to its left, and every domino falling to the right pushes the adjacent domino directly to its right. If an upright domino is pushed from both sides simultaneously, it remains upright due to the balance of forces.
Return a string representing the final state of the dominoes after all movement has ceased.
Constraints:
dominoes.length
dominoes[i] is either 'L', 'R', or '.'.