标签:find car oda string 依次 nim 如何 lis drop
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:
[
"---+++-+---+",
"---+++---+-+",
"---+---+++-+",
"-----+-+++-+"
]
标签:find car oda string 依次 nim 如何 lis drop
原文地址:https://www.cnblogs.com/yunxintryyoubest/p/12571823.html