Flip Game
Description
null
Solution(javascript)
/**
* @param {string} s
* @return {string[]}
*/
var generatePossibleNextMoves = function(s) {
const result = []
for(let i = 0; i < s.length-1; i++) {
if(s[i] === "+" && s[i+1] ==="+") {
const str = s.slice(0, i) + "--" + s.slice(i+2)
result.push(str)
}
}
return result
};