问题:
难度:medium
说明:
给出一个字符,字符只包含 'L' 'R' '.' 三种字符,其实整个数组是表示一个多米诺骨牌状态, L 表示当前的骨牌处于 左倒 状态, R 表示骨牌 右倒 状态,. 表示树立,没有倒下的状态。
要求当前给出的数组状态,求出最终的多米诺骨牌状态,设定所有骨牌倒下运动速度一样。
题目连接:https://leetcode.com/problems/push-dominoes/
输入范围:
n == dominoes.length
1 <= n <= 105
dominoes[i]
is either'L'
,'R'
, or'.'
.
输入案例:
Example 1:
Input: dominoes = "RR.L"
Output: "RR.L"
Explanation: The first domino expends no additional force on the second domino.
Example 2:
Input: dominoes = ".L.R...LR..L.."
Output: "LL.RR.LLRRLL.."