Alice and Bob are playing a game consisting of s of length s[i] represents the creature Alice summons in the
'F' represents a Fire Dragon
'W' represents a Water Serpent
'E' represents an Earth Golem
In each round, Bob also summons one of these three creatures. The outcome of each round is determined as follows:
Fire Dragon beats Earth Golem ('F' beats 'E').
Water Serpent beats Fire Dragon ('W' beats 'F').
Earth Golem beats Water Serpent ('E' beats 'W').
In every round:
If Bob summons a creature that beats Alice’s creature, Bob receives
If Alice’s creature beats Bob’s creature, Bob loses
If both summon the same creature, neither receives points (
Bob must follow a strict constraint: he cannot summon the same creature in two consecutive rounds.
Bob wins the game if his total points at the end of all
Return the number of distinct winning move sequences Bob can make. Since the answer can be large, return it modulo
Constraints:
s.length
s[i] is one of 'F', 'W', or 'E'.
Alice and Bob are playing a game consisting of s of length s[i] represents the creature Alice summons in the
'F' represents a Fire Dragon
'W' represents a Water Serpent
'E' represents an Earth Golem
In each round, Bob also summons one of these three creatures. The outcome of each round is determined as follows:
Fire Dragon beats Earth Golem ('F' beats 'E').
Water Serpent beats Fire Dragon ('W' beats 'F').
Earth Golem beats Water Serpent ('E' beats 'W').
In every round:
If Bob summons a creature that beats Alice’s creature, Bob receives
If Alice’s creature beats Bob’s creature, Bob loses
If both summon the same creature, neither receives points (
Bob must follow a strict constraint: he cannot summon the same creature in two consecutive rounds.
Bob wins the game if his total points at the end of all
Return the number of distinct winning move sequences Bob can make. Since the answer can be large, return it modulo
Constraints:
s.length
s[i] is one of 'F', 'W', or 'E'.