914. 翻转游戏
中文English
You are playing the following Flip Game with your friend: Given a string that contains only two characters: +
and -
, you can flip two consecutive "++"
into "--"
, you can only flip one time. Please find all strings that can be obtained after one flip.
Write a program to find all possible states of the string after one valid move.
样例
Example1
Input: s = "++++"
Output:
[
"--++",
"+--+",
"++--"
]
Example2
Input: s = "---+++-+++-+"
Output:
[
"---+++-+---+",
"---+++---+-+",
"---+---+++-+",
"-----+-+++-+"
]