def generatePossibleNextMoves(self, s):
return [s[:i] + "--" + s[i+2:] for i in range(len(s) - 1) if s[i] == s[i + 1] == "+"]
very nice! I have the same method but yours is much shorter
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.